From 770295e24f31ab58b94cd417d5f59f601f07244c Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Mon, 30 Mar 2015 23:08:59 +1300 Subject: Add GL200 milage value --- src/org/traccar/protocol/Gl200ProtocolDecoder.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/org/traccar') 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; -- cgit v1.2.3