diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2017-12-06 14:53:03 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2017-12-06 14:53:22 +1300 |
commit | 9ec8be4360ad3088af66d9fd432d9a85cd0ee074 (patch) | |
tree | 2955c967858b3f4251eeb69c598263c14614f64d /src/org/traccar/protocol/Jt600ProtocolDecoder.java | |
parent | c166601c0344ca826043c15688aac43de3c490d1 (diff) | |
download | trackermap-server-9ec8be4360ad3088af66d9fd432d9a85cd0ee074.tar.gz trackermap-server-9ec8be4360ad3088af66d9fd432d9a85cd0ee074.tar.bz2 trackermap-server-9ec8be4360ad3088af66d9fd432d9a85cd0ee074.zip |
Support JT701 protocol version
Diffstat (limited to 'src/org/traccar/protocol/Jt600ProtocolDecoder.java')
-rw-r--r-- | src/org/traccar/protocol/Jt600ProtocolDecoder.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/Jt600ProtocolDecoder.java b/src/org/traccar/protocol/Jt600ProtocolDecoder.java index 58835c7d6..e935c1449 100644 --- a/src/org/traccar/protocol/Jt600ProtocolDecoder.java +++ b/src/org/traccar/protocol/Jt600ProtocolDecoder.java @@ -63,8 +63,9 @@ public class Jt600ProtocolDecoder extends BaseProtocolDecoder { return null; } + int protocolVersion = 0; if (longFormat) { - buf.readUnsignedByte(); // protocol + protocolVersion = buf.readUnsignedByte(); } int version = BitUtil.from(buf.readUnsignedByte(), 4); @@ -122,6 +123,11 @@ public class Jt600ProtocolDecoder extends BaseProtocolDecoder { cellTower.setSignalStrength((int) buf.readUnsignedByte()); position.setNetwork(new Network(cellTower)); + if (protocolVersion == 0x17) { + buf.readUnsignedByte(); // geofence id + buf.skipBytes(3); // reserved + } + } else if (version == 1) { position.set(Position.KEY_SATELLITES, buf.readUnsignedByte()); |