From 4237194639161293e97d79443bb152819320c862 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 21 Dec 2013 20:17:57 +1300 Subject: Improve GL200 decoder --- src/org/traccar/protocol/Gl200ProtocolDecoder.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src') diff --git a/src/org/traccar/protocol/Gl200ProtocolDecoder.java b/src/org/traccar/protocol/Gl200ProtocolDecoder.java index f1101bde4..4c55a97a1 100644 --- a/src/org/traccar/protocol/Gl200ProtocolDecoder.java +++ b/src/org/traccar/protocol/Gl200ProtocolDecoder.java @@ -45,6 +45,11 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder { "(-?\\d+\\.\\d+)," + // Latitude "(\\d{4})(\\d{2})(\\d{2})" + // Date (YYYYMMDD) "(\\d{2})(\\d{2})(\\d{2})," + // Time (HHMMSS) + "(\\d{4})," + // MCC + "(\\d{4})," + // MNC + "(\\p{XDigit}{4})," + // LAC + "(\\p{XDigit}{4})," + // Cell + "(?:.*,(\\d{1,3}),\\d{14},)?" + // Battery ".*"); @Override @@ -98,6 +103,18 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder { time.set(Calendar.SECOND, Integer.valueOf(parser.group(index++))); position.setTime(time.getTime()); + // Cell information + extendedInfo.set("mcc", parser.group(index++)); + extendedInfo.set("mnc", parser.group(index++)); + 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)); + } + position.setExtendedInfo(extendedInfo.toString()); return position; } -- cgit v1.2.3