aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/protocol/DmtProtocolDecoder.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/traccar/protocol/DmtProtocolDecoder.java')
-rw-r--r--src/main/java/org/traccar/protocol/DmtProtocolDecoder.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/main/java/org/traccar/protocol/DmtProtocolDecoder.java b/src/main/java/org/traccar/protocol/DmtProtocolDecoder.java
index 75fdc3253..96b06557a 100644
--- a/src/main/java/org/traccar/protocol/DmtProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/DmtProtocolDecoder.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2017 - 2019 Anton Tananaev (anton@traccar.org)
+ * Copyright 2017 - 2021 Anton Tananaev (anton@traccar.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -197,7 +197,8 @@ public class DmtProtocolDecoder extends BaseProtocolDecoder {
} else if (fieldId == 6) {
while (buf.readerIndex() < fieldEnd) {
- switch (buf.readUnsignedByte()) {
+ int number = buf.readUnsignedByte();
+ switch (number) {
case 1:
position.set(Position.KEY_BATTERY, buf.readUnsignedShortLE() * 0.001);
break;
@@ -214,7 +215,7 @@ public class DmtProtocolDecoder extends BaseProtocolDecoder {
position.set("solarPower", buf.readUnsignedShortLE() * 0.001);
break;
default:
- buf.readUnsignedShortLE(); // other
+ position.set(Position.PREFIX_IO + number, buf.readUnsignedShortLE());
break;
}
}