aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/GoSafeProtocolDecoder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-03-19 09:30:16 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2016-03-19 09:30:16 +1300
commitbeddf46069c0e1a656cd2c2263fcb4309ccb0ac9 (patch)
tree5ed2059f92a811148cc3edcfedcfc88e9cc2c6c3 /src/org/traccar/protocol/GoSafeProtocolDecoder.java
parentb965ff36e6daf270da8026e7828981ad3f4d67ab (diff)
downloadtrackermap-server-beddf46069c0e1a656cd2c2263fcb4309ccb0ac9.tar.gz
trackermap-server-beddf46069c0e1a656cd2c2263fcb4309ccb0ac9.tar.bz2
trackermap-server-beddf46069c0e1a656cd2c2263fcb4309ccb0ac9.zip
Decode GSM data for GoSafe protocol
Diffstat (limited to 'src/org/traccar/protocol/GoSafeProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/GoSafeProtocolDecoder.java18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/GoSafeProtocolDecoder.java b/src/org/traccar/protocol/GoSafeProtocolDecoder.java
index dc9298e71..2e562d63e 100644
--- a/src/org/traccar/protocol/GoSafeProtocolDecoder.java
+++ b/src/org/traccar/protocol/GoSafeProtocolDecoder.java
@@ -64,7 +64,15 @@ public class GoSafeProtocolDecoder extends BaseProtocolDecoder {
.expression(",?")
.groupEnd()
.groupBegin()
- .text("GSM:").expression("[^,]*,?")
+ .text("GSM:")
+ .number("d+;") // registration
+ .number("d+;") // gsm signal
+ .number("(d+);") // mcc
+ .number("(d+);") // mnc
+ .number("(x+);") // lac
+ .number("(x+);") // cid
+ .number("-d+") // rssi
+ .expression("[^,]*,?")
.groupEnd("?")
.groupBegin()
.text("COT:")
@@ -139,6 +147,14 @@ public class GoSafeProtocolDecoder extends BaseProtocolDecoder {
position.setAltitude(parser.nextDouble());
position.set(Event.KEY_HDOP, parser.next());
+
+ if (parser.hasNext(4)) {
+ position.set(Event.KEY_MCC, parser.nextInt());
+ position.set(Event.KEY_MNC, parser.nextInt());
+ position.set(Event.KEY_LAC, parser.nextInt(16));
+ position.set(Event.KEY_CID, parser.nextInt(16));
+ }
+
position.set(Event.KEY_ODOMETER, parser.next());
position.set(Event.KEY_POWER, parser.next());
position.set(Event.KEY_BATTERY, parser.next());