diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/org/traccar/protocol/RuptelaProtocolDecoder.java | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/protocol/RuptelaProtocolDecoder.java b/src/main/java/org/traccar/protocol/RuptelaProtocolDecoder.java index 1755ba8a8..294768860 100644 --- a/src/main/java/org/traccar/protocol/RuptelaProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/RuptelaProtocolDecoder.java @@ -236,7 +236,18 @@ public class RuptelaProtocolDecoder extends BaseProtocolDecoder { buf.readUnsignedByte(); // timestamp extension if (type == MSG_EXTENDED_RECORDS) { - buf.readUnsignedByte(); // record extension + int b = buf.readUnsignedByte(); // record extension + int noRecordsToMerge = (b & 0xf0) >> 4; + int currentRecord = b & 0x0f; + + if (currentRecord > 0 && noRecordsToMerge >= currentRecord) { + if (!positions.isEmpty() + && positions.get(positions.size() - 1).getDeviceTime() + .compareTo(position.getDeviceTime()) == 0) { + position = positions.remove(positions.size() - 1); + } + } + } buf.readUnsignedByte(); // priority (reserved) |