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