diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2019-09-25 00:26:31 -0700 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2019-09-25 00:26:31 -0700 |
commit | 8f2c293e0fc7a0ddcfcc4aa86cbbfc01d5b098be (patch) | |
tree | 1a3034b55771bec425fe45650a72d573ebcdf60a | |
parent | 3f4053552bde461ba2ef6686a83c08e2b1122472 (diff) | |
download | trackermap-server-8f2c293e0fc7a0ddcfcc4aa86cbbfc01d5b098be.tar.gz trackermap-server-8f2c293e0fc7a0ddcfcc4aa86cbbfc01d5b098be.tar.bz2 trackermap-server-8f2c293e0fc7a0ddcfcc4aa86cbbfc01d5b098be.zip |
Support M101 protocol
-rw-r--r-- | src/main/java/org/traccar/protocol/Jt600ProtocolDecoder.java | 2 | ||||
-rw-r--r-- | src/test/java/org/traccar/protocol/Jt600ProtocolDecoderTest.java | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/protocol/Jt600ProtocolDecoder.java b/src/main/java/org/traccar/protocol/Jt600ProtocolDecoder.java index da055dff3..82abeb42e 100644 --- a/src/main/java/org/traccar/protocol/Jt600ProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/Jt600ProtocolDecoder.java @@ -92,7 +92,7 @@ public class Jt600ProtocolDecoder extends BaseProtocolDecoder { buf.readByte(); // header - boolean longFormat = buf.getUnsignedByte(buf.readerIndex()) == 0x75; + boolean longFormat = buf.getUnsignedByte(buf.readerIndex()) >> 4 == 0x7; String id = String.valueOf(Long.parseLong(ByteBufUtil.hexDump(buf.readSlice(5)))); DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, id); diff --git a/src/test/java/org/traccar/protocol/Jt600ProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/Jt600ProtocolDecoderTest.java index 074d34711..4a3c752cd 100644 --- a/src/test/java/org/traccar/protocol/Jt600ProtocolDecoderTest.java +++ b/src/test/java/org/traccar/protocol/Jt600ProtocolDecoderTest.java @@ -12,6 +12,9 @@ public class Jt600ProtocolDecoderTest extends ProtocolTest { Jt600ProtocolDecoder decoder = new Jt600ProtocolDecoder(null); verifyPositions(decoder, binary( + "2478807035371711003419081920061851380856003256223b000000000000070000000020c0ff965d54de1800000f0f0f0f0f0f0f0f0f0f02d600ea0a21")); + + verifyPositions(decoder, binary( "2475201509261611002313101503464722331560113555309F00000000002D0500CB206800F064109326381A03")); verifyPositions(decoder, binary( |