aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2019-09-16 22:37:23 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2019-09-16 22:37:23 -0700
commita0db98120af45c33994428f69c2018cf5a459a02 (patch)
treedcc2f1af006dd912c613f24c507b62b6980c6038 /src/main
parent1fe86dd41b3d20f2023844d56712b8d225160024 (diff)
downloadtrackermap-server-a0db98120af45c33994428f69c2018cf5a459a02.tar.gz
trackermap-server-a0db98120af45c33994428f69c2018cf5a459a02.tar.bz2
trackermap-server-a0db98120af45c33994428f69c2018cf5a459a02.zip
Add missing alarms
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/traccar/protocol/RaceDynamicsProtocolDecoder.java18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/main/java/org/traccar/protocol/RaceDynamicsProtocolDecoder.java b/src/main/java/org/traccar/protocol/RaceDynamicsProtocolDecoder.java
index 0261199a3..f441bf8ed 100644
--- a/src/main/java/org/traccar/protocol/RaceDynamicsProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/RaceDynamicsProtocolDecoder.java
@@ -71,6 +71,17 @@ public class RaceDynamicsProtocolDecoder extends BaseProtocolDecoder {
.number("(d+),") // power
.number("[01],") // power status
.number("(d+),") // battery
+ .number("([01]),") // panic
+ .number("d+,")
+ .number("d+,")
+ .number("(d),") // overspeed
+ .number("d+,") // speed limit
+ .number("d+,") // tachometer
+ .number("d+,d+,d+,") // aux
+ .number("d+,") // geofence id
+ .number("d+,") // road speed type
+ .number("d+,") // ibutton count
+ .number("(d),") // overdriver alert
.any()
.compile();
@@ -135,6 +146,13 @@ public class RaceDynamicsProtocolDecoder extends BaseProtocolDecoder {
position.set(Position.KEY_DRIVER_UNIQUE_ID, parser.next());
position.set(Position.KEY_POWER, parser.nextInt() * 0.01);
position.set(Position.KEY_BATTERY, parser.nextInt() * 0.01);
+ position.set(Position.KEY_ALARM, parser.nextInt() > 0 ? Position.ALARM_SOS : null);
+ position.set(Position.KEY_ALARM, parser.nextInt() > 0 ? Position.ALARM_OVERSPEED : null);
+
+ int overDriver = parser.nextInt();
+ if (overDriver > 0) {
+ position.set("overDriver", overDriver);
+ }
positions.add(position);