From 220a9fa8d05cd0e0d1459e6da852c82e0412d163 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Fri, 12 Nov 2021 21:52:12 -0800 Subject: Decode location type --- src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java b/src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java index 3c01c0468..871410c44 100644 --- a/src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java @@ -501,11 +501,15 @@ public class HuabaoProtocolDecoder extends BaseProtocolDecoder { List positions = new LinkedList<>(); int count = buf.readUnsignedShort(); - buf.readUnsignedByte(); // location type + int locationType = buf.readUnsignedByte(); for (int i = 0; i < count; i++) { int endIndex = buf.readUnsignedShort() + buf.readerIndex(); - positions.add(decodeLocation(deviceSession, buf)); + Position position = decodeLocation(deviceSession, buf); + if (locationType == 0) { + position.set(Position.KEY_ARCHIVE, true); + } + positions.add(position); buf.readerIndex(endIndex); } -- cgit v1.2.3