From 5a582f6316511199d43b4c15e7d1759932f9874b Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Mon, 18 Jun 2018 16:19:33 +1200 Subject: Decode JT600 status flags --- src/org/traccar/protocol/Jt600ProtocolDecoder.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/org') diff --git a/src/org/traccar/protocol/Jt600ProtocolDecoder.java b/src/org/traccar/protocol/Jt600ProtocolDecoder.java index 87996a0c3..109f8a68a 100644 --- a/src/org/traccar/protocol/Jt600ProtocolDecoder.java +++ b/src/org/traccar/protocol/Jt600ProtocolDecoder.java @@ -145,7 +145,15 @@ public class Jt600ProtocolDecoder extends BaseProtocolDecoder { buf.readUnsignedInt(); // vehicle id combined - position.set(Position.KEY_STATUS, buf.readUnsignedShort()); + int status = buf.readUnsignedShort(); + position.set(Position.KEY_ALARM, BitUtil.check(status, 1) ? Position.ALARM_GEOFENCE_ENTER : null); + position.set(Position.KEY_ALARM, BitUtil.check(status, 2) ? Position.ALARM_GEOFENCE_EXIT : null); + position.set(Position.KEY_ALARM, BitUtil.check(status, 3) ? Position.ALARM_POWER_CUT : null); + position.set(Position.KEY_ALARM, BitUtil.check(status, 4) ? Position.ALARM_VIBRATION : null); + position.set(Position.KEY_BLOCKED, BitUtil.check(status, 7)); + position.set(Position.KEY_ALARM, BitUtil.check(status, 8 + 3) ? Position.ALARM_LOW_BATTERY : null); + position.set(Position.KEY_ALARM, BitUtil.check(status, 8 + 6) ? Position.ALARM_FAULT : null); + position.set(Position.KEY_STATUS, status); int battery = buf.readUnsignedByte(); if (battery == 0xff) { -- cgit v1.2.3