aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/Gl200ProtocolDecoder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-02-24 22:46:32 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2016-02-24 22:46:32 +1300
commit2bcaeff435d1e1fa10ab253241e3d722ad29b153 (patch)
tree3c2d3bef1caf478bd62b3134d414c1b85075a285 /src/org/traccar/protocol/Gl200ProtocolDecoder.java
parentfcd74ee0e418a82fe118920d67c824bbfbe984a2 (diff)
downloadtrackermap-server-2bcaeff435d1e1fa10ab253241e3d722ad29b153.tar.gz
trackermap-server-2bcaeff435d1e1fa10ab253241e3d722ad29b153.tar.bz2
trackermap-server-2bcaeff435d1e1fa10ab253241e3d722ad29b153.zip
Decode additional GL200 protocol data
Diffstat (limited to 'src/org/traccar/protocol/Gl200ProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/Gl200ProtocolDecoder.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/org/traccar/protocol/Gl200ProtocolDecoder.java b/src/org/traccar/protocol/Gl200ProtocolDecoder.java
index 62d93ce13..91e8d86bc 100644
--- a/src/org/traccar/protocol/Gl200ProtocolDecoder.java
+++ b/src/org/traccar/protocol/Gl200ProtocolDecoder.java
@@ -135,7 +135,7 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder {
.number("(?:[0-9A-Z]{2}xxxx)?,") // protocol version
.number("(d{15}|x{14}),") // imei
.expression("[^,]*,") // device name
- .number("d*,")
+ .number("(d+)?,") // power
.number("d{1,2},") // report type
.number("d{1,2},") // count
.expression("((?:")
@@ -146,7 +146,7 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder {
.number("(d{1,3})?,") // battery
.or()
.number("(d{1,7}.d)?,") // odometer
- .number("d{5}:dd:dd,") // hour meter
+ .number("(d{5}:dd:dd),") // hour meter
.number("(x+)?,") // adc 1
.number("(x+)?,") // adc 2
.number("(d{1,3})?,") // battery
@@ -321,6 +321,8 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder {
return null;
}
+ int power = parser.nextInt();
+
Parser itemParser = new Parser(PATTERN_LOCATION, parser.next());
while (itemParser.find()) {
Position position = new Position();
@@ -336,10 +338,15 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder {
decodeLocation(position, parser);
+ if (power > 10) {
+ position.set(Event.KEY_POWER, power);
+ }
+
position.set(Event.KEY_ODOMETER, parser.next());
position.set(Event.KEY_BATTERY, parser.next());
position.set(Event.KEY_ODOMETER, parser.next());
+ position.set(Event.KEY_HOURS, parser.next());
position.set(Event.PREFIX_ADC + 1, parser.next());
position.set(Event.PREFIX_ADC + 2, parser.next());
position.set(Event.KEY_BATTERY, parser.next());