diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2013-03-10 13:12:14 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2013-03-10 13:12:14 +1300 |
commit | a353cbf806f21767f6a173255141dd7db8314fe8 (patch) | |
tree | 836b338e37588768d667e5335100d33e6b458054 /src/org/traccar/protocol | |
parent | e69316a43169e16d1cb347536177886ed5785873 (diff) | |
download | trackermap-server-a353cbf806f21767f6a173255141dd7db8314fe8.tar.gz trackermap-server-a353cbf806f21767f6a173255141dd7db8314fe8.tar.bz2 trackermap-server-a353cbf806f21767f6a173255141dd7db8314fe8.zip |
Fix TLT-2H protocol (fix #162)
Diffstat (limited to 'src/org/traccar/protocol')
-rw-r--r-- | src/org/traccar/protocol/Tlt2hProtocolDecoder.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/org/traccar/protocol/Tlt2hProtocolDecoder.java b/src/org/traccar/protocol/Tlt2hProtocolDecoder.java index 531ae28b6..66146b6fb 100644 --- a/src/org/traccar/protocol/Tlt2hProtocolDecoder.java +++ b/src/org/traccar/protocol/Tlt2hProtocolDecoder.java @@ -38,7 +38,7 @@ public class Tlt2hProtocolDecoder extends BaseProtocolDecoder { * Regular expressions pattern */ static private Pattern pattern = Pattern.compile( - "#([0-9a-f]+)" + // Cell info + "#([0-9a-f]+)?" + // Cell info "\\$GPRMC," + "(\\d{2})(\\d{2})(\\d{2})\\.(\\d+)," + // Time (HHMMSS.SSS) "([AV])," + // Validity @@ -81,9 +81,10 @@ public class Tlt2hProtocolDecoder extends BaseProtocolDecoder { Integer index = 1; // Cell - extendedInfo.append("<cell>"); - extendedInfo.append(parser.group(index++)); - extendedInfo.append("</cell>"); + String cell = parser.group(index++); + if (cell != null) { + extendedInfo.append("<cell>").append(cell).append("</cell>"); + } // Time Calendar time = Calendar.getInstance(TimeZone.getTimeZone("UTC")); |