aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/traccar')
-rw-r--r--src/main/java/org/traccar/protocol/TeltonikaProtocolDecoder.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/protocol/TeltonikaProtocolDecoder.java b/src/main/java/org/traccar/protocol/TeltonikaProtocolDecoder.java
index 89124cb22..ff1f52eb1 100644
--- a/src/main/java/org/traccar/protocol/TeltonikaProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/TeltonikaProtocolDecoder.java
@@ -325,6 +325,7 @@ public class TeltonikaProtocolDecoder extends BaseProtocolDecoder {
if (codec == CODEC_GH3000) {
decodeGh3000Parameter(position, id, buf, length);
} else {
+ int index = buf.readerIndex();
boolean decoded = false;
for (var entry : PARAMETERS.getOrDefault(id, new HashMap<>()).entrySet()) {
if (entry.getKey() == null || model != null && entry.getKey().contains(model)) {
@@ -333,7 +334,9 @@ public class TeltonikaProtocolDecoder extends BaseProtocolDecoder {
break;
}
}
- if (!decoded) {
+ if (decoded) {
+ buf.readerIndex(index + length);
+ } else {
position.set(Position.PREFIX_IO + id, readValue(buf, length));
}
}