aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/protocol/DmtProtocolDecoder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2021-02-09 22:11:38 -0800
committerAnton Tananaev <anton.tananaev@gmail.com>2021-02-09 22:11:38 -0800
commitcdad129c3c1f335a870d6395a645c454236b3d8f (patch)
tree8d05c9f5bbd18a9ff753f5258b1275376e9dd194 /src/main/java/org/traccar/protocol/DmtProtocolDecoder.java
parentef45ad3dc840cef5ded156095ea8b2a70faf15d6 (diff)
downloadtrackermap-server-cdad129c3c1f335a870d6395a645c454236b3d8f.tar.gz
trackermap-server-cdad129c3c1f335a870d6395a645c454236b3d8f.tar.bz2
trackermap-server-cdad129c3c1f335a870d6395a645c454236b3d8f.zip
Decode other analogue attributes
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;
}
}