diff options
Diffstat (limited to 'src/org/traccar/protocol/NoranProtocolDecoder.java')
-rw-r--r-- | src/org/traccar/protocol/NoranProtocolDecoder.java | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/NoranProtocolDecoder.java b/src/org/traccar/protocol/NoranProtocolDecoder.java index c2161d9c9..aaecfc1db 100644 --- a/src/org/traccar/protocol/NoranProtocolDecoder.java +++ b/src/org/traccar/protocol/NoranProtocolDecoder.java @@ -90,7 +90,23 @@ public class NoranProtocolDecoder extends BaseProtocolDecoder { position.setValid(BitUtil.check(buf.readUnsignedByte(), 0)); - position.set(Position.KEY_ALARM, buf.readUnsignedByte()); + short alarm = buf.readUnsignedByte(); + switch (alarm) { + case 1: + position.set(Position.KEY_ALARM, Position.ALARM_SOS); + break; + case 2: + position.set(Position.KEY_ALARM, Position.ALARM_OVERSPEED); + break; + case 3: + position.set(Position.KEY_ALARM, Position.ALARM_GEOFENCE_EXIT); + break; + case 9: + position.set(Position.KEY_ALARM, Position.ALARM_POWER_OFF); + break; + default: + break; + } if (newFormat) { position.setSpeed(UnitsConverter.knotsFromKph(buf.readUnsignedInt())); |