diff options
Diffstat (limited to 'src/org/traccar/protocol/WatchProtocolDecoder.java')
-rw-r--r-- | src/org/traccar/protocol/WatchProtocolDecoder.java | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/org/traccar/protocol/WatchProtocolDecoder.java b/src/org/traccar/protocol/WatchProtocolDecoder.java index 57f5d7e78..86dc9456d 100644 --- a/src/org/traccar/protocol/WatchProtocolDecoder.java +++ b/src/org/traccar/protocol/WatchProtocolDecoder.java @@ -76,8 +76,6 @@ public class WatchProtocolDecoder extends BaseProtocolDecoder { return Position.ALARM_GEOFENCE_ENTER; } else if (BitUtil.check(status, 3)) { return Position.ALARM_OVERSPEED; - } else if (BitUtil.check(status, 4)) { - return Position.ALARM_MOVEMENT; } else if (BitUtil.check(status, 16)) { return Position.ALARM_SOS; } else if (BitUtil.check(status, 17)) { @@ -207,9 +205,13 @@ public class WatchProtocolDecoder extends BaseProtocolDecoder { position.set(Position.KEY_RSSI, parser.nextInt(0)); position.set(Position.KEY_BATTERY_LEVEL, parser.nextInt(0)); - position.set("steps", parser.nextInt(0)); + position.set(Position.KEY_STEPS, parser.nextInt(0)); - position.set(Position.KEY_ALARM, decodeAlarm(parser.nextHexInt(0))); + int status = parser.nextHexInt(0); + position.set(Position.KEY_ALARM, decodeAlarm(status)); + if (BitUtil.check(status, 4)) { + position.set(Position.KEY_MOTION, true); + } decodeTail(position, parser.next()); |