From cdad129c3c1f335a870d6395a645c454236b3d8f Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Tue, 9 Feb 2021 22:11:38 -0800 Subject: Decode other analogue attributes --- src/main/java/org/traccar/protocol/DmtProtocolDecoder.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/main/java/org/traccar/protocol') 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; } } -- cgit v1.2.3