diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2021-11-12 21:52:12 -0800 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2021-11-12 21:52:12 -0800 |
commit | 220a9fa8d05cd0e0d1459e6da852c82e0412d163 (patch) | |
tree | 81710f80ee51a12a98cd0de96242cc03c70406e8 /src/main/java/org/traccar | |
parent | 148b251ff1c129b4b8c8038a47e1dc55a05e6f5d (diff) | |
download | trackermap-server-220a9fa8d05cd0e0d1459e6da852c82e0412d163.tar.gz trackermap-server-220a9fa8d05cd0e0d1459e6da852c82e0412d163.tar.bz2 trackermap-server-220a9fa8d05cd0e0d1459e6da852c82e0412d163.zip |
Decode location type
Diffstat (limited to 'src/main/java/org/traccar')
-rw-r--r-- | src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java | 8 |
1 files 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<Position> 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); } |