aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-02-24 00:33:02 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2016-02-24 00:33:02 +1300
commitdebe7092f6d48abc51852b808f45144863baebde (patch)
tree44d2605815a8b36b43588e90bdcd8bc8c36c44fe /src/org/traccar/protocol
parent5741cd0fdbddb623f1807463d9a8d26cf5cc8f4d (diff)
downloadtrackermap-server-debe7092f6d48abc51852b808f45144863baebde.tar.gz
trackermap-server-debe7092f6d48abc51852b808f45144863baebde.tar.bz2
trackermap-server-debe7092f6d48abc51852b808f45144863baebde.zip
Add another GL200 decoder test case
Diffstat (limited to 'src/org/traccar/protocol')
-rw-r--r--src/org/traccar/protocol/Gl200ProtocolDecoder.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/org/traccar/protocol/Gl200ProtocolDecoder.java b/src/org/traccar/protocol/Gl200ProtocolDecoder.java
index 9098cbd8c..62d93ce13 100644
--- a/src/org/traccar/protocol/Gl200ProtocolDecoder.java
+++ b/src/org/traccar/protocol/Gl200ProtocolDecoder.java
@@ -142,6 +142,7 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder {
.expression(PATTERN_LOCATION.pattern())
.expression(")+)")
.groupBegin()
+ .number("(d{1,7}.d)?,").optional() // odometer
.number("(d{1,3})?,") // battery
.or()
.number("(d{1,7}.d)?,") // odometer
@@ -169,6 +170,7 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder {
.number("d{1,2},") // count
.expression(PATTERN_LOCATION.pattern())
.groupBegin()
+ .number("(d{1,7}.d)?,").optional() // odometer
.number("(d{1,3})?,") // battery
.or()
.number("(d{1,7}.d)?,") // odometer
@@ -334,6 +336,7 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder {
decodeLocation(position, parser);
+ position.set(Event.KEY_ODOMETER, parser.next());
position.set(Event.KEY_BATTERY, parser.next());
position.set(Event.KEY_ODOMETER, parser.next());
@@ -361,7 +364,9 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder {
decodeLocation(position, parser);
+ position.set(Event.KEY_ODOMETER, parser.next());
position.set(Event.KEY_BATTERY, parser.next());
+
position.set(Event.KEY_ODOMETER, parser.next());
if (parser.hasNext(6)) {