aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorMatjaž Črnko <m.crnko@txt.si>2023-06-21 19:15:44 +0200
committerMatjaž Črnko <m.crnko@txt.si>2023-06-21 19:15:44 +0200
commite43d353b7cc0f2bf34a77d58529c1360683d81c1 (patch)
tree2a764ba49070372ebfd319c38a782b42e9861b86 /src/main
parent648e7f652a5ca1024813864b2dea2572c9f5e3f0 (diff)
downloadtrackermap-server-e43d353b7cc0f2bf34a77d58529c1360683d81c1.tar.gz
trackermap-server-e43d353b7cc0f2bf34a77d58529c1360683d81c1.tar.bz2
trackermap-server-e43d353b7cc0f2bf34a77d58529c1360683d81c1.zip
Ruptela Decoder - extended records merging, remove redudant checks and better variable naming
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/traccar/protocol/RuptelaProtocolDecoder.java10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/main/java/org/traccar/protocol/RuptelaProtocolDecoder.java b/src/main/java/org/traccar/protocol/RuptelaProtocolDecoder.java
index a8296771a..d067d2ddc 100644
--- a/src/main/java/org/traccar/protocol/RuptelaProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/RuptelaProtocolDecoder.java
@@ -238,15 +238,11 @@ public class RuptelaProtocolDecoder extends BaseProtocolDecoder {
if (type == MSG_EXTENDED_RECORDS) {
int recordExtension = buf.readUnsignedByte();
- int noRecordsToMerge = BitUtil.between(recordExtension, 4, 8);
+ int mergeRecordCount = BitUtil.between(recordExtension, 4, 8);
int currentRecord = BitUtil.to(recordExtension, 4);
- if (currentRecord > 0 && currentRecord <= noRecordsToMerge) {
- if (!positions.isEmpty()
- && positions.get(positions.size() - 1).getDeviceTime()
- .compareTo(position.getDeviceTime()) == 0) {
- position = positions.remove(positions.size() - 1);
- }
+ if (currentRecord > 0 && currentRecord <= mergeRecordCount) {
+ position = positions.remove(positions.size() - 1);
}
}