diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2018-02-12 19:23:07 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2018-02-12 19:23:07 +1300 |
commit | 7802fa7bc91de74e17e79dd5175df31de36d17a8 (patch) | |
tree | 1b37002a060737a93290e665cd271fc88baf65b8 /src/org/traccar/protocol | |
parent | e6f5d3acf27f6705881f5b956ec505fd78bad7a4 (diff) | |
download | trackermap-server-7802fa7bc91de74e17e79dd5175df31de36d17a8.tar.gz trackermap-server-7802fa7bc91de74e17e79dd5175df31de36d17a8.tar.bz2 trackermap-server-7802fa7bc91de74e17e79dd5175df31de36d17a8.zip |
Decode additional Totem alarm codes
Diffstat (limited to 'src/org/traccar/protocol')
-rw-r--r-- | src/org/traccar/protocol/TotemProtocolDecoder.java | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/TotemProtocolDecoder.java b/src/org/traccar/protocol/TotemProtocolDecoder.java index 2f205ba58..1c5130a6c 100644 --- a/src/org/traccar/protocol/TotemProtocolDecoder.java +++ b/src/org/traccar/protocol/TotemProtocolDecoder.java @@ -167,12 +167,26 @@ public class TotemProtocolDecoder extends BaseProtocolDecoder { switch (value) { case 0x01: return Position.ALARM_SOS; + case 0x02: + return Position.ALARM_OVERSPEED; + case 0x04: + return Position.ALARM_GEOFENCE_EXIT; + case 0x05: + return Position.ALARM_GEOFENCE_ENTER; + case 0x06: + return Position.ALARM_TOW; case 0x10: return Position.ALARM_LOW_BATTERY; case 0x11: return Position.ALARM_OVERSPEED; + case 0x12: + return Position.ALARM_LOW_POWER; + case 0x13: + return Position.ALARM_LOW_BATTERY; case 0x30: return Position.ALARM_PARKING; + case 0x40: + return Position.ALARM_SHOCK; case 0x42: return Position.ALARM_GEOFENCE_EXIT; case 0x43: @@ -245,7 +259,11 @@ public class TotemProtocolDecoder extends BaseProtocolDecoder { private boolean decode3(Position position, Parser parser) { if (parser.hasNext()) { - position.set(Position.KEY_ALARM, decodeAlarm(Short.parseShort(parser.next(), 16))); + short alarm = Short.parseShort(parser.next(), 16); + position.set(Position.KEY_ALARM, decodeAlarm(alarm)); + if (alarm >= 0x21 && alarm <= 0x28) { + position.set(Position.PREFIX_IN + ((alarm - 0x21) / 2 + 1), alarm % 2 > 0); + } } position.setTime(parser.nextDateTime(Parser.DateTimeFormat.DMY_HMS)); |