diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2017-05-19 06:12:19 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2017-05-19 06:12:19 +1200 |
commit | 92d00e9c9b50b438565896c05046674737c7ec62 (patch) | |
tree | f8c4641cbcb15637b752f518edfc44df3ae30b63 | |
parent | d9c3568535f8a3ef9cedb43f7c48e839e2940d1f (diff) | |
download | trackermap-server-92d00e9c9b50b438565896c05046674737c7ec62.tar.gz trackermap-server-92d00e9c9b50b438565896c05046674737c7ec62.tar.bz2 trackermap-server-92d00e9c9b50b438565896c05046674737c7ec62.zip |
Add more AT PLUS alarms
-rw-r--r-- | src/org/traccar/protocol/Gl200ProtocolDecoder.java | 16 | ||||
-rw-r--r-- | test/org/traccar/protocol/Gl200ProtocolDecoderTest.java | 9 |
2 files changed, 25 insertions, 0 deletions
diff --git a/src/org/traccar/protocol/Gl200ProtocolDecoder.java b/src/org/traccar/protocol/Gl200ProtocolDecoder.java index 3d39369bf..5f4dc3cbd 100644 --- a/src/org/traccar/protocol/Gl200ProtocolDecoder.java +++ b/src/org/traccar/protocol/Gl200ProtocolDecoder.java @@ -759,9 +759,25 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder { decodeDeviceTime(position, parser); switch (type) { + case "PNA": + position.set(Position.KEY_ALARM, Position.ALARM_POWER_ON); + break; + case "PFA": + position.set(Position.KEY_ALARM, Position.ALARM_POWER_OFF); + break; + case "EPN": + position.set(Position.KEY_ALARM, Position.ALARM_POWER_RESTORED); + break; + case "EPF": + position.set(Position.KEY_ALARM, Position.ALARM_POWER_CUT); + break; case "BPL": position.set(Position.KEY_ALARM, Position.ALARM_LOW_BATTERY); break; + case "STT": + position.set(Position.KEY_ALARM, Position.ALARM_MOVEMENT); + break; + case "TMP": case "TEM": position.set(Position.KEY_ALARM, Position.ALARM_TEMPERATURE); break; diff --git a/test/org/traccar/protocol/Gl200ProtocolDecoderTest.java b/test/org/traccar/protocol/Gl200ProtocolDecoderTest.java index 70bcd46b2..55a5d93ca 100644 --- a/test/org/traccar/protocol/Gl200ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Gl200ProtocolDecoderTest.java @@ -10,6 +10,15 @@ public class Gl200ProtocolDecoderTest extends ProtocolTest { Gl200ProtocolDecoder decoder = new Gl200ProtocolDecoder(new Gl200Protocol()); + verifyPosition(decoder, text( + "+RESP:GTTMP,110100,358688000000158,,2,60,1,1,4.3,92,70.0,121.354335,31.222073,20110214013254,0460,0000,18d8,6141,00,80,20110214093254,000F$")); + + verifyPosition(decoder, text( + "+RESP:GTSTT,110100,358688000000158,,41,0,4.3,92,70.0,121.354335,31.222073,20110214013254,0460,0000,18d8,6141,,20110214093254,0022$")); + + verifyPosition(decoder, text( + "+RESP:GTBPL,110100,358688000000158,,3.53,0,4.3,92,70.0,121.354335,31.222073,20110214013254,0460,0000,18d8,6141,,20110214093254,001F$")); + verifyNotNull(decoder, text( "+BUFF:GTIGL,060228,862894020180553,,,00,1,1,3.4,199,409.6,-63.174466,-17.739317,20170407121823,0000,0000,0000,0000,00,15989.5,20170407081824,9606$")); |