aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-04-29 10:03:33 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2015-04-29 10:03:33 +1200
commit7df211d6c7365b494e758741f5bd5194c7eaaf39 (patch)
tree3db0f70940f29f246a9794985738624d9001835c
parenta5f47492857a175548beff07cfb565129f687ae2 (diff)
downloadtrackermap-server-7df211d6c7365b494e758741f5bd5194c7eaaf39.tar.gz
trackermap-server-7df211d6c7365b494e758741f5bd5194c7eaaf39.tar.bz2
trackermap-server-7df211d6c7365b494e758741f5bd5194c7eaaf39.zip
Handle TK103 long milage
-rw-r--r--src/org/traccar/protocol/Tk103ProtocolDecoder.java2
-rw-r--r--test/org/traccar/protocol/Tk103ProtocolDecoderTest.java3
2 files changed, 4 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/Tk103ProtocolDecoder.java b/src/org/traccar/protocol/Tk103ProtocolDecoder.java
index b0186a52b..493287011 100644
--- a/src/org/traccar/protocol/Tk103ProtocolDecoder.java
+++ b/src/org/traccar/protocol/Tk103ProtocolDecoder.java
@@ -140,7 +140,7 @@ public class Tk103ProtocolDecoder extends BaseProtocolDecoder {
// Milage
String milage = parser.group(index++);
if (milage != null) {
- extendedInfo.set("milage", Integer.parseInt(milage, 16));
+ extendedInfo.set("milage", Long.parseLong(milage, 16));
}
position.setExtendedInfo(extendedInfo.toString());
diff --git a/test/org/traccar/protocol/Tk103ProtocolDecoderTest.java b/test/org/traccar/protocol/Tk103ProtocolDecoderTest.java
index f8df401fe..18e6142ad 100644
--- a/test/org/traccar/protocol/Tk103ProtocolDecoderTest.java
+++ b/test/org/traccar/protocol/Tk103ProtocolDecoderTest.java
@@ -15,6 +15,9 @@ public class Tk103ProtocolDecoderTest extends ProtocolDecoderTest {
assertNull(decoder.decode(null, null, "(090411121854BP0000001234567890HSO"));
verify(decoder.decode(null, null,
+ "(01029131573BR00150428A3801.6382N02351.0159E000.0080729278.7800000000LEF9ECB9C)"));
+
+ verify(decoder.decode(null, null,
"(035988863964BP05000035988863964110524A4241.7977N02318.7561E000.0123536356.5100000000L000946BB"));
verify(decoder.decode(null, null,