aboutsummaryrefslogtreecommitdiff
path: root/src/org
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2018-06-18 16:19:33 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2018-06-18 16:19:33 +1200
commit5a582f6316511199d43b4c15e7d1759932f9874b (patch)
treecad54761babef5fc4c3a91183ccd852d819f343c /src/org
parent95f20c6803c03d31ef36cf129702e701121d71a2 (diff)
downloadtrackermap-server-5a582f6316511199d43b4c15e7d1759932f9874b.tar.gz
trackermap-server-5a582f6316511199d43b4c15e7d1759932f9874b.tar.bz2
trackermap-server-5a582f6316511199d43b4c15e7d1759932f9874b.zip
Decode JT600 status flags
Diffstat (limited to 'src/org')
-rw-r--r--src/org/traccar/protocol/Jt600ProtocolDecoder.java10
1 files changed, 9 insertions, 1 deletions
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) {