diff options
author | Anton Tananaev <anton@traccar.org> | 2022-07-19 16:32:12 -0700 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2022-07-19 16:32:12 -0700 |
commit | d75bda2f95081e49272d9f6cadd89b1ba398f888 (patch) | |
tree | cc611e96f67d3d567329a069f27326cac55c9d17 /src/main/java | |
parent | 4d37fc1ec3c4d3ba8e9421df08bb40979b19b5db (diff) | |
download | trackermap-server-d75bda2f95081e49272d9f6cadd89b1ba398f888.tar.gz trackermap-server-d75bda2f95081e49272d9f6cadd89b1ba398f888.tar.bz2 trackermap-server-d75bda2f95081e49272d9f6cadd89b1ba398f888.zip |
Better ADC decoding (fix #4899)
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/org/traccar/protocol/MeitrackProtocolDecoder.java | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/main/java/org/traccar/protocol/MeitrackProtocolDecoder.java b/src/main/java/org/traccar/protocol/MeitrackProtocolDecoder.java index 87459d3fc..88b7d12c8 100644 --- a/src/main/java/org/traccar/protocol/MeitrackProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/MeitrackProtocolDecoder.java @@ -211,11 +211,11 @@ public class MeitrackProtocolDecoder extends BaseProtocolDecoder { switch (deviceModel.toUpperCase()) { case "MVT340": case "MVT380": - position.set(Position.KEY_BATTERY, parser.nextHexInt(0) * 3.0 * 2.0 / 1024.0); + position.set(Position.KEY_BATTERY, parser.nextHexInt() * 3.0 * 2.0 / 1024.0); position.set(Position.KEY_POWER, parser.nextHexInt(0) * 3.0 * 16.0 / 1024.0); break; case "MT90": - position.set(Position.KEY_BATTERY, parser.nextHexInt(0) * 3.3 * 2.0 / 4096.0); + position.set(Position.KEY_BATTERY, parser.nextHexInt() * 3.3 * 2.0 / 4096.0); position.set(Position.KEY_POWER, parser.nextHexInt(0)); break; case "T1": @@ -225,19 +225,18 @@ public class MeitrackProtocolDecoder extends BaseProtocolDecoder { case "MVT800": case "TC68": case "TC68S": - position.set(Position.KEY_BATTERY, parser.nextHexInt(0) * 3.3 * 2.0 / 4096.0); + position.set(Position.KEY_BATTERY, parser.nextHexInt() * 3.3 * 2.0 / 4096.0); position.set(Position.KEY_POWER, parser.nextHexInt(0) * 3.3 * 16.0 / 4096.0); break; case "T311": case "T322X": case "T333": case "T355": - position.set(Position.KEY_BATTERY, parser.nextHexInt(0) / 100.0); - position.set(Position.KEY_POWER, parser.nextHexInt(0) / 100.0); - break; + case "T366": + case "T366G": default: - position.set(Position.KEY_BATTERY, parser.nextHexInt(0)); - position.set(Position.KEY_POWER, parser.nextHexInt(0)); + position.set(Position.KEY_BATTERY, parser.nextHexInt() / 100.0); + position.set(Position.KEY_POWER, parser.nextHexInt(0) / 100.0); break; } |