aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/protocol
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2020-09-18 00:02:08 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2020-09-18 00:02:08 -0700
commit34feb9862f03ad0b10ce6425943a9b43a7d5c71f (patch)
tree87904b6b1228fc07c4a1b66eb4e24b0eb879f4e0 /src/main/java/org/traccar/protocol
parentbe296c9342c69b2ccb0136abccb2167f395e9e95 (diff)
downloadtrackermap-server-34feb9862f03ad0b10ce6425943a9b43a7d5c71f.tar.gz
trackermap-server-34feb9862f03ad0b10ce6425943a9b43a7d5c71f.tar.bz2
trackermap-server-34feb9862f03ad0b10ce6425943a9b43a7d5c71f.zip
Decode odometer value
Diffstat (limited to 'src/main/java/org/traccar/protocol')
-rw-r--r--src/main/java/org/traccar/protocol/ItsProtocolDecoder.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/main/java/org/traccar/protocol/ItsProtocolDecoder.java b/src/main/java/org/traccar/protocol/ItsProtocolDecoder.java
index f66669a98..94c9a3038 100644
--- a/src/main/java/org/traccar/protocol/ItsProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/ItsProtocolDecoder.java
@@ -90,6 +90,10 @@ public class ItsProtocolDecoder extends BaseProtocolDecoder {
.number("(-?d+),") // tilt x
.or()
.number("d+,") // index
+ .number("(d+.?d*),") // odometer
+ .number("x+,") // checksum
+ .or()
+ .number("d+,") // index
.number("(d+.?d*),") // adc1
.number("(d+.?d*),") // adc2
.groupEnd("?")
@@ -244,6 +248,10 @@ public class ItsProtocolDecoder extends BaseProtocolDecoder {
position.set("tiltX", parser.nextInt());
}
+ if (parser.hasNext()) {
+ position.set(Position.KEY_ODOMETER, parser.nextDouble() * 1000);
+ }
+
if (parser.hasNext(2)) {
position.set(Position.PREFIX_ADC + 1, parser.nextDouble());
position.set(Position.PREFIX_ADC + 2, parser.nextDouble());