aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java2
-rw-r--r--src/test/java/org/traccar/protocol/HuabaoProtocolDecoderTest.java3
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(