aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-11-05 15:04:07 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2016-11-05 15:04:07 +1300
commit77d193bf840ceb5294a6cb0d0cd6e1512e2b1efb (patch)
treed846b6081e24b0eb3c4098b6bae392b4546143d7
parent227c9e4d087da882fbaad71cd67e26fd194864ee (diff)
downloadtraccar-server-77d193bf840ceb5294a6cb0d0cd6e1512e2b1efb.tar.gz
traccar-server-77d193bf840ceb5294a6cb0d0cd6e1512e2b1efb.tar.bz2
traccar-server-77d193bf840ceb5294a6cb0d0cd6e1512e2b1efb.zip
Support new Totem protocol format
-rw-r--r--src/org/traccar/protocol/TotemProtocolDecoder.java2
-rw-r--r--test/org/traccar/protocol/TotemProtocolDecoderTest.java6
2 files changed, 8 insertions, 0 deletions
diff --git a/src/org/traccar/protocol/TotemProtocolDecoder.java b/src/org/traccar/protocol/TotemProtocolDecoder.java
index 121b56ff9..1fe91b942 100644
--- a/src/org/traccar/protocol/TotemProtocolDecoder.java
+++ b/src/org/traccar/protocol/TotemProtocolDecoder.java
@@ -138,9 +138,11 @@ public class TotemProtocolDecoder extends BaseProtocolDecoder {
.number("(dd)") // external power
.number("(dddd)") // adc 1
.groupBegin()
+ .groupBegin()
.number("(dddd)") // adc 2
.number("(dddd)") // adc 3
.number("(dddd)") // adc 4
+ .groupEnd("?")
.number("(dddd)") // temperature 1
.number("(dddd)") // temperature 2
.groupEnd("?")
diff --git a/test/org/traccar/protocol/TotemProtocolDecoderTest.java b/test/org/traccar/protocol/TotemProtocolDecoderTest.java
index 8ff2e6f11..89400fe22 100644
--- a/test/org/traccar/protocol/TotemProtocolDecoderTest.java
+++ b/test/org/traccar/protocol/TotemProtocolDecoderTest.java
@@ -11,6 +11,12 @@ public class TotemProtocolDecoderTest extends ProtocolTest {
TotemProtocolDecoder decoder = new TotemProtocolDecoder(new TotemProtocol());
verifyPosition(decoder, text(
+ "$$0116AA864244026065291|18001800140916020524401100000000000027BA0E57063100000001.200000002237.8119N11403.5075E052020"));
+
+ verifyPosition(decoder, text(
+ "$$0116AA867119025683137|108000001611020925324112000000000000616027F7001300000099.900000000000.0000N00000.0000E531824"));
+
+ verifyPosition(decoder, text(
"$$0128AA864244026065291|18001800140916020524401100000000000000000000000027BA0E57063100000001.200000002237.8119N11403.5075E05202D"));
verifyPosition(decoder, text(