aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-03-30 23:08:59 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2015-03-30 23:08:59 +1300
commit770295e24f31ab58b94cd417d5f59f601f07244c (patch)
treef9bf7e2d20ec0e56835792355102701b9d393cff /src
parentd5589821cd437fcce5f12e82a6dfe05f57262542 (diff)
downloadtrackermap-server-770295e24f31ab58b94cd417d5f59f601f07244c.tar.gz
trackermap-server-770295e24f31ab58b94cd417d5f59f601f07244c.tar.bz2
trackermap-server-770295e24f31ab58b94cd417d5f59f601f07244c.zip
Add GL200 milage value
Diffstat (limited to 'src')
-rw-r--r--src/org/traccar/protocol/Gl200ProtocolDecoder.java12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/org/traccar/protocol/Gl200ProtocolDecoder.java b/src/org/traccar/protocol/Gl200ProtocolDecoder.java
index f8f32effd..0ce8bff5e 100644
--- a/src/org/traccar/protocol/Gl200ProtocolDecoder.java
+++ b/src/org/traccar/protocol/Gl200ProtocolDecoder.java
@@ -52,7 +52,8 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder {
"(\\d{4})?," + // MNC
"(\\p{XDigit}{4})?," + // LAC
"(\\p{XDigit}{4})?," + // Cell
- "(?:.*,(\\d{1,3}),\\d{14},)?" + // Battery
+ "(?:(\\d+\\.\\d)?," + // Milage
+ "(\\d{1,3})?)?" + // Battery
".*");
@Override
@@ -133,11 +134,12 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder {
extendedInfo.set("lac", parser.group(index++));
extendedInfo.set("cell", parser.group(index++));
- // Battery
- String battery = parser.group(index++);
- if (battery != null) {
- extendedInfo.set("battery", Integer.valueOf(battery));
+ // Other
+ String milage = parser.group(index++);
+ if (milage != null && Double.valueOf(milage) != 0) {
+ extendedInfo.set("milage", milage);
}
+ extendedInfo.set("battery", parser.group(index++));
position.setExtendedInfo(extendedInfo.toString());
return position;