diff options
author | Anton Tananaev <anton@traccar.org> | 2023-02-27 19:31:44 -0800 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2023-02-27 19:31:44 -0800 |
commit | 3331593759a21a1fa36cb64332e14828f7e522f0 (patch) | |
tree | 937ed7683d5a631835740626523fa3a8d853d0fa /src | |
parent | 5284faae8ce9ed077035167063c8d2977d06a8fd (diff) | |
download | trackermap-server-3331593759a21a1fa36cb64332e14828f7e522f0.tar.gz trackermap-server-3331593759a21a1fa36cb64332e14828f7e522f0.tar.bz2 trackermap-server-3331593759a21a1fa36cb64332e14828f7e522f0.zip |
Fix alarm and driving behavior
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java | 2 | ||||
-rw-r--r-- | src/test/java/org/traccar/protocol/HuabaoProtocolDecoderTest.java | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java b/src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java index d0bbeebb5..f79641bcf 100644 --- a/src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java @@ -847,7 +847,7 @@ public class HuabaoProtocolDecoder extends BaseProtocolDecoder { case 0x03: count = buf.readUnsignedByte(); for (int i = 0; i < count; i++) { - int id = buf.readUnsignedShort(); + int id = buf.readUnsignedByte(); int length = buf.readUnsignedByte(); switch (id) { case 0x1A: diff --git a/src/test/java/org/traccar/protocol/HuabaoProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/HuabaoProtocolDecoderTest.java index e91c84d79..04c3a8cd3 100644 --- a/src/test/java/org/traccar/protocol/HuabaoProtocolDecoderTest.java +++ b/src/test/java/org/traccar/protocol/HuabaoProtocolDecoderTest.java @@ -15,6 +15,9 @@ public class HuabaoProtocolDecoderTest extends ProtocolTest { "7e010200204f07788ef67601824f4459344f544d314d4459774d4441314d444977626d5633553235536457786cba7e")); verifyPosition(decoder, binary( + "7e0900001f4f07788ef87d000cf0230223150215010203013800000c000b029dc58c04b99b60230223171822507e")); + + verifyPosition(decoder, binary( "7e0200004107904226220608ca0000010000000010031dac0d004864f30000000000002212291003220104000179a7300107310100eb17000300e151000300e304000b00d801041edf340000306b007e")); verifyPosition(decoder, binary( |