aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/Gl200ProtocolDecoder.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/protocol/Gl200ProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/Gl200ProtocolDecoder.java14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/org/traccar/protocol/Gl200ProtocolDecoder.java b/src/org/traccar/protocol/Gl200ProtocolDecoder.java
index 29884bb00..42786d4fe 100644
--- a/src/org/traccar/protocol/Gl200ProtocolDecoder.java
+++ b/src/org/traccar/protocol/Gl200ProtocolDecoder.java
@@ -116,7 +116,9 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder {
.text(",")
.number("(0ddd)?,") // mcc
.number("(0ddd)?,") // mnc
- .number("(xxxx|x{8})?,") // loc
+ .number("(?:xxxx)?")
+ .number("(xxxx)").optional(2) // lac
+ .text(",")
.number("(xxxx)?,") // cell
.groupBegin()
.number("(d+.d)?,") // odometer
@@ -215,10 +217,12 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder {
getLastLocation(position, null);
}
- position.set(Event.KEY_MCC, parser.next());
- position.set(Event.KEY_MNC, parser.next());
- position.set(Event.KEY_LAC, parser.next());
- position.set(Event.KEY_CID, 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_BATTERY, parser.next());