From 34feb9862f03ad0b10ce6425943a9b43a7d5c71f Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Fri, 18 Sep 2020 00:02:08 -0700 Subject: Decode odometer value --- src/main/java/org/traccar/protocol/ItsProtocolDecoder.java | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/main/java') 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()); -- cgit v1.2.3