aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2020-07-15 08:26:42 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2020-07-15 08:26:42 -0700
commit03de8348981e36ffcc88196de79a679ec5d1d82d (patch)
tree156e379b6d3ec0dfef3ae7e79862686c951d8227 /src/main/java/org/traccar
parent5233a4b109a3e19ef2846d0bcd9f1ead71d70439 (diff)
downloadtrackermap-server-03de8348981e36ffcc88196de79a679ec5d1d82d.tar.gz
trackermap-server-03de8348981e36ffcc88196de79a679ec5d1d82d.tar.bz2
trackermap-server-03de8348981e36ffcc88196de79a679ec5d1d82d.zip
Decode missing parameters
Diffstat (limited to 'src/main/java/org/traccar')
-rw-r--r--src/main/java/org/traccar/protocol/ItsProtocolDecoder.java27
1 files changed, 24 insertions, 3 deletions
diff --git a/src/main/java/org/traccar/protocol/ItsProtocolDecoder.java b/src/main/java/org/traccar/protocol/ItsProtocolDecoder.java
index 1e0a4603c..f66669a98 100644
--- a/src/main/java/org/traccar/protocol/ItsProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/ItsProtocolDecoder.java
@@ -67,9 +67,9 @@ public class ItsProtocolDecoder extends BaseProtocolDecoder {
.number("(d+),") // satellites
.groupBegin()
.number("(d+.?d*),") // altitude
- .number("d+.?d*,") // pdop
- .number("d+.?d*,") // hdop
- .expression("[^,]*,") // operator
+ .number("(d+.?d*),") // pdop
+ .number("(d+.?d*),") // hdop
+ .expression("([^,]+)?,") // operator
.number("([01]),") // ignition
.number("([01]),") // charging
.number("(d+.?d*),") // power
@@ -81,6 +81,15 @@ public class ItsProtocolDecoder extends BaseProtocolDecoder {
.number("([01]{2}),") // outputs
.groupBegin()
.number("d+,") // index
+ .number("(d+.?d*),") // odometer
+ .number("(d+.?d*),") // adc1
+ .number("(-?d+.?d*),") // acceleration x
+ .number("(-?d+.?d*),") // acceleration y
+ .number("(-?d+.?d*),") // acceleration z
+ .number("(-?d+),") // tilt y
+ .number("(-?d+),") // tilt x
+ .or()
+ .number("d+,") // index
.number("(d+.?d*),") // adc1
.number("(d+.?d*),") // adc2
.groupEnd("?")
@@ -188,6 +197,9 @@ public class ItsProtocolDecoder extends BaseProtocolDecoder {
if (parser.hasNext(8)) {
position.setAltitude(parser.nextDouble());
+ position.set(Position.KEY_PDOP, parser.nextDouble());
+ position.set(Position.KEY_HDOP, parser.nextDouble());
+ position.set(Position.KEY_OPERATOR, parser.next());
position.set(Position.KEY_IGNITION, parser.nextInt() > 0);
position.set(Position.KEY_CHARGE, parser.nextInt() > 0);
position.set(Position.KEY_POWER, parser.nextDouble());
@@ -223,6 +235,15 @@ public class ItsProtocolDecoder extends BaseProtocolDecoder {
position.set(Position.KEY_OUTPUT, parser.nextBinInt());
}
+ if (parser.hasNext(7)) {
+ position.set(Position.KEY_ODOMETER, parser.nextDouble() * 1000);
+ position.set(Position.PREFIX_ADC + 1, parser.nextDouble());
+ position.set(Position.KEY_G_SENSOR,
+ "[" + parser.nextDouble() + "," + parser.nextDouble() + "," + parser.nextDouble() + "]");
+ position.set("tiltY", parser.nextInt());
+ position.set("tiltX", parser.nextInt());
+ }
+
if (parser.hasNext(2)) {
position.set(Position.PREFIX_ADC + 1, parser.nextDouble());
position.set(Position.PREFIX_ADC + 2, parser.nextDouble());