From b39ade422f42d5423db203dab87886d3f8f63dd1 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Fri, 2 Dec 2016 05:06:11 +1300 Subject: Add GPS103 power cut alarm --- src/org/traccar/protocol/Gps103ProtocolDecoder.java | 2 ++ test/org/traccar/protocol/Gps103ProtocolDecoderTest.java | 3 +++ 2 files changed, 5 insertions(+) diff --git a/src/org/traccar/protocol/Gps103ProtocolDecoder.java b/src/org/traccar/protocol/Gps103ProtocolDecoder.java index 57dc784d3..d929ae917 100644 --- a/src/org/traccar/protocol/Gps103ProtocolDecoder.java +++ b/src/org/traccar/protocol/Gps103ProtocolDecoder.java @@ -119,6 +119,8 @@ public class Gps103ProtocolDecoder extends BaseProtocolDecoder { return Position.ALARM_POWER_OFF; case "door alarm": return Position.ALARM_DOOR; + case "ac alarm": + return Position.ALARM_POWER_CUT; default: return null; } diff --git a/test/org/traccar/protocol/Gps103ProtocolDecoderTest.java b/test/org/traccar/protocol/Gps103ProtocolDecoderTest.java index 2640051fb..93817b575 100644 --- a/test/org/traccar/protocol/Gps103ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Gps103ProtocolDecoderTest.java @@ -10,6 +10,9 @@ public class Gps103ProtocolDecoderTest extends ProtocolTest { Gps103ProtocolDecoder decoder = new Gps103ProtocolDecoder(new Gps103Protocol()); + verifyAttributes(decoder, text( + "imei:862106021237716,ac alarm,1611291645,,F,204457.000,A,1010.2783,N,06441.0274,W,0.00,,;")); + verifyAttributes(decoder, text( "imei:359710049057798,OBD,161003192752,1785,,,0,54,96.47%,75,20.00%,1892,0.00,P0134,P0571,,;")); -- cgit v1.2.3