diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2016-02-02 09:09:14 +1100 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2016-02-02 09:09:14 +1100 |
commit | 4807127711bb934ab6dbcbbe5d92290a1e576166 (patch) | |
tree | 63b05b40b16ceeaf7951612a0e30101c22f3fd8c | |
parent | 2e2801348be8b8d502e7c082a2be16d1fc83984d (diff) | |
download | trackermap-server-4807127711bb934ab6dbcbbe5d92290a1e576166.tar.gz trackermap-server-4807127711bb934ab6dbcbbe5d92290a1e576166.tar.bz2 trackermap-server-4807127711bb934ab6dbcbbe5d92290a1e576166.zip |
Fix ADC value decoding for Disha
-rw-r--r-- | src/org/traccar/protocol/DishaProtocolDecoder.java | 2 | ||||
-rw-r--r-- | test/org/traccar/protocol/DishaProtocolDecoderTest.java | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/DishaProtocolDecoder.java b/src/org/traccar/protocol/DishaProtocolDecoder.java index f9b7579d3..37ff29fac 100644 --- a/src/org/traccar/protocol/DishaProtocolDecoder.java +++ b/src/org/traccar/protocol/DishaProtocolDecoder.java @@ -94,7 +94,7 @@ public class DishaProtocolDecoder extends BaseProtocolDecoder { position.set(Event.KEY_BATTERY, parser.next()); position.set(Event.PREFIX_ADC + 1, parser.nextInt()); - position.set(Event.PREFIX_ADC + 1, parser.nextInt()); + position.set(Event.PREFIX_ADC + 2, parser.nextInt()); position.set(Event.KEY_ODOMETER, parser.next()); position.set(Event.KEY_INPUT, parser.next()); diff --git a/test/org/traccar/protocol/DishaProtocolDecoderTest.java b/test/org/traccar/protocol/DishaProtocolDecoderTest.java index 99ceecc52..17e27e4f8 100644 --- a/test/org/traccar/protocol/DishaProtocolDecoderTest.java +++ b/test/org/traccar/protocol/DishaProtocolDecoderTest.java @@ -11,6 +11,9 @@ public class DishaProtocolDecoderTest extends ProtocolTest { DishaProtocolDecoder decoder = new DishaProtocolDecoder(new DishaProtocol()); verifyPosition(decoder, text( + "$A#A#864161028848856#A#053523#010216#2232.7733#N#08821.1940#E#002.75#038.1#09#00.8#1800#0#000#0000#9999#11.7#285.7#0001*")); + + verifyPosition(decoder, text( "$A#A#864161028848856#A#182134#090116#2232.0191#N#08821.3278#E#001.74#231.4#04#01.5#1300#0#000#0000#9999#54.4#6407.7#0000*"), position("2016-01-09 18:21:34.000", true, 22.53365, 88.35546)); |