diff options
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/org/traccar/protocol/SolarPoweredProtocolDecoder.java | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/main/java/org/traccar/protocol/SolarPoweredProtocolDecoder.java b/src/main/java/org/traccar/protocol/SolarPoweredProtocolDecoder.java index 30cbf9217..a1ce7c649 100644 --- a/src/main/java/org/traccar/protocol/SolarPoweredProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/SolarPoweredProtocolDecoder.java @@ -87,20 +87,23 @@ public class SolarPoweredProtocolDecoder extends BaseProtocolDecoder { position.setCourse(buf.readUnsignedByte()); break; case 0x82: - buf.readUnsignedByte(); // alarm mask + int alarmMask = buf.readUnsignedByte(); int alarm = buf.readUnsignedByte(); - if (BitUtil.check(alarm, 0)) { + if (BitUtil.check(alarmMask, 0) && BitUtil.check(alarm, 0)) { position.set(Position.KEY_ALARM, Position.ALARM_TAMPERING); } - if (BitUtil.check(alarm, 1)) { + if (BitUtil.check(alarmMask, 1) && BitUtil.check(alarm, 1)) { position.set(Position.KEY_ALARM, Position.ALARM_LOW_POWER); } - if (BitUtil.check(alarm, 2)) { + if (BitUtil.check(alarmMask, 2) && BitUtil.check(alarm, 2)) { position.set(Position.KEY_ALARM, Position.ALARM_SOS); } - if (BitUtil.check(alarm, 3)) { + if (BitUtil.check(alarmMask, 3) && BitUtil.check(alarm, 3)) { position.set(Position.KEY_ALARM, Position.ALARM_FALL_DOWN); } + if (BitUtil.check(alarmMask, 4)) { + position.set(Position.ALARM_MOVEMENT, BitUtil.check(alarm, 4)); + } break; case 0x83: buf.readUnsignedInt(); // uptime |