From 77d193bf840ceb5294a6cb0d0cd6e1512e2b1efb Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 5 Nov 2016 15:04:07 +1300 Subject: Support new Totem protocol format --- src/org/traccar/protocol/TotemProtocolDecoder.java | 2 ++ test/org/traccar/protocol/TotemProtocolDecoderTest.java | 6 ++++++ 2 files changed, 8 insertions(+) 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 @@ -10,6 +10,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")); -- cgit v1.2.3