diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2017-10-15 11:15:55 +0800 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2017-10-15 11:15:55 +0800 |
commit | 3f5a5e81fe08c7ae0b136d52b4840d5085e12f23 (patch) | |
tree | e0604f1471140ca10ff9ae4725521914d7429373 /src | |
parent | e876250991faccdca04a1f36ddaf847c9f392275 (diff) | |
download | trackermap-server-3f5a5e81fe08c7ae0b136d52b4840d5085e12f23.tar.gz trackermap-server-3f5a5e81fe08c7ae0b136d52b4840d5085e12f23.tar.bz2 trackermap-server-3f5a5e81fe08c7ae0b136d52b4840d5085e12f23.zip |
Update tzone protocol
Diffstat (limited to 'src')
-rw-r--r-- | src/org/traccar/protocol/TzoneProtocolDecoder.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/TzoneProtocolDecoder.java b/src/org/traccar/protocol/TzoneProtocolDecoder.java index 76903c90c..079ad3126 100644 --- a/src/org/traccar/protocol/TzoneProtocolDecoder.java +++ b/src/org/traccar/protocol/TzoneProtocolDecoder.java @@ -203,7 +203,16 @@ public class TzoneProtocolDecoder extends BaseProtocolDecoder { if (blockLength >= 13) { position.set(Position.KEY_ALARM, decodeAlarm(buf.readUnsignedByte())); position.set("terminalInfo", buf.readUnsignedByte()); - position.set(Position.PREFIX_IO + 1, buf.readUnsignedShort()); + + int status = buf.readUnsignedByte(); + position.set(Position.PREFIX_OUT + 1, BitUtil.check(status, 0)); + position.set(Position.PREFIX_OUT + 2, BitUtil.check(status, 1)); + status = buf.readUnsignedByte(); + position.set(Position.PREFIX_IN + 1, BitUtil.check(status, 4)); + if (BitUtil.check(status, 0)) { + position.set(Position.KEY_ALARM, Position.ALARM_SOS); + } + position.set(Position.KEY_RSSI, buf.readUnsignedByte()); position.set("gsmStatus", buf.readUnsignedByte()); position.set(Position.KEY_BATTERY, buf.readUnsignedShort()); |