From 7ae0d8de4b5c78e9265a9a5cbb5b19ef19a4f017 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sun, 8 Oct 2017 13:43:01 +0800 Subject: Support alternative Xexun ignition --- src/org/traccar/protocol/XexunProtocolDecoder.java | 2 ++ test/org/traccar/protocol/XexunProtocolDecoderTest.java | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/src/org/traccar/protocol/XexunProtocolDecoder.java b/src/org/traccar/protocol/XexunProtocolDecoder.java index a5a38c370..ca0a8669e 100644 --- a/src/org/traccar/protocol/XexunProtocolDecoder.java +++ b/src/org/traccar/protocol/XexunProtocolDecoder.java @@ -68,9 +68,11 @@ public class XexunProtocolDecoder extends BaseProtocolDecoder { if (value != null) { switch (value.toLowerCase()) { case "acc on": + case "ACCStart": position.set(Position.KEY_IGNITION, true); break; case "acc off": + case "ACCStop": position.set(Position.KEY_IGNITION, false); break; case "help me!": diff --git a/test/org/traccar/protocol/XexunProtocolDecoderTest.java b/test/org/traccar/protocol/XexunProtocolDecoderTest.java index 686d3f53f..8587ee295 100644 --- a/test/org/traccar/protocol/XexunProtocolDecoderTest.java +++ b/test/org/traccar/protocol/XexunProtocolDecoderTest.java @@ -55,6 +55,12 @@ public class XexunProtocolDecoderTest extends ProtocolTest { decoder = new XexunProtocolDecoder(new XexunProtocol(), true); + verifyPosition(decoder, text( + "171007160505,,GPRMC,160505.000,A,5323.4680,N,00252.4202,W,000.0,129.7,071017,,,A*7A,F,ACCStart, imei:864504031916915,10,41.1,F:4.28V,1,135,19824,234,15,0062,B7D5")); + + verifyPosition(decoder, text( + "171007160525,,GPRMC,160525.000,A,5323.4680,N,00252.4202,W,000.0,129.7,071017,,,A*78,F,ACCStop, imei:864504031916915,10,41.1,F:4.28V,1,134,42896,234,15,0062,B7D5")); + verifyPosition(decoder, text( "170505103845,TELKOMSEL,GPRMC,103845.000,A,0340.2482,N,09841.9689,E,0.00,68.23,050517,,,A*5D,F,ACC On, imei:013227002782161,05,-8.2,F:4.22V,1,141,44712,510,10,2BE5,EC47")); -- cgit v1.2.3