diff options
author | Nikolay Vlahovski <nvlahovski@gmail.com> | 2023-05-18 09:35:27 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-18 09:35:27 +0300 |
commit | adbe25e9daa125e989c853068bc600c61234c342 (patch) | |
tree | bcba9f4c91ed6dbb5dc29a275fe24c063c1c145b /src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java | |
parent | 074dc016d21f9848140d125c2812d8abf25e8d53 (diff) | |
parent | fbd3ee0d77673d94766a87aa67c05885e44aa7e5 (diff) | |
download | trackermap-server-adbe25e9daa125e989c853068bc600c61234c342.tar.gz trackermap-server-adbe25e9daa125e989c853068bc600c61234c342.tar.bz2 trackermap-server-adbe25e9daa125e989c853068bc600c61234c342.zip |
Merge branch 'traccar:master' into master
Diffstat (limited to 'src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java')
-rw-r--r-- | src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java b/src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java index 4beee7696..ee5ab19d6 100644 --- a/src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java @@ -919,14 +919,19 @@ public class HuabaoProtocolDecoder extends BaseProtocolDecoder { position.setTime(time); break; case 0x02: - count = buf.readUnsignedByte(); + List<String> codes = new LinkedList<>(); + count = buf.readUnsignedShort(); for (int i = 0; i < count; i++) { buf.readUnsignedInt(); // system id int codeCount = buf.readUnsignedShort(); for (int j = 0; j < codeCount; j++) { - buf.skipBytes(16); // code + buf.readUnsignedInt(); // dtc + buf.readUnsignedInt(); // status + codes.add(buf.readCharSequence( + buf.readUnsignedShort(), StandardCharsets.US_ASCII).toString().trim()); } } + position.set(Position.KEY_DTCS, String.join(" ", codes)); getLastLocation(position, time); decodeCoordinates(position, buf); position.setTime(time); |