aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2019-06-02 10:40:20 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2019-06-02 10:40:20 -0700
commit808c78a5e6074a3e5051396280b0cafc026ff673 (patch)
treea2e38464eb9b9ad8f48ba287ca7b709120b45a1a /src/main/java
parent48b7368edb18985265dcba2fdaf4d80fc9f19bae (diff)
downloadtrackermap-server-808c78a5e6074a3e5051396280b0cafc026ff673.tar.gz
trackermap-server-808c78a5e6074a3e5051396280b0cafc026ff673.tar.bz2
trackermap-server-808c78a5e6074a3e5051396280b0cafc026ff673.zip
Decode additional Atrack attributes
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/org/traccar/protocol/AtrackProtocolDecoder.java30
1 files changed, 27 insertions, 3 deletions
diff --git a/src/main/java/org/traccar/protocol/AtrackProtocolDecoder.java b/src/main/java/org/traccar/protocol/AtrackProtocolDecoder.java
index c018b2651..53f04234d 100644
--- a/src/main/java/org/traccar/protocol/AtrackProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/AtrackProtocolDecoder.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2013 - 2018 Anton Tananaev (anton@traccar.org)
+ * Copyright 2013 - 2019 Anton Tananaev (anton@traccar.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -160,7 +160,7 @@ public class AtrackProtocolDecoder extends BaseProtocolDecoder {
position.set(Position.KEY_THROTTLE, Integer.parseInt(values[i]));
break;
case "ET":
- position.set(Position.PREFIX_TEMP + 1, Integer.parseInt(values[i]));
+ position.set(Position.KEY_COOLANT_TEMP, Integer.parseInt(values[i]));
break;
case "FL":
position.set(Position.KEY_FUEL_LEVEL, Integer.parseInt(values[i]));
@@ -175,7 +175,31 @@ public class AtrackProtocolDecoder extends BaseProtocolDecoder {
position.set(Position.KEY_ICCID, values[i]);
break;
case "EH":
- position.set(Position.KEY_HOURS, UnitsConverter.msFromHours(Integer.parseInt(values[i])));
+ position.set(Position.KEY_HOURS, UnitsConverter.msFromHours(Integer.parseInt(values[i]) * 0.1));
+ break;
+ case "IA":
+ position.set("intakeTemp", Integer.parseInt(values[i]));
+ break;
+ case "EL":
+ position.set(Position.KEY_ENGINE_LOAD, Integer.parseInt(values[i]));
+ break;
+ case "HA":
+ if (Integer.parseInt(values[i]) > 0) {
+ position.set(Position.KEY_ALARM, Position.ALARM_ACCELERATION);
+ }
+ break;
+ case "HB":
+ if (Integer.parseInt(values[i]) > 0) {
+ position.set(Position.KEY_ALARM, Position.ALARM_BRAKING);
+ }
+ break;
+ case "HC":
+ if (Integer.parseInt(values[i]) > 0) {
+ position.set(Position.KEY_ALARM, Position.ALARM_CORNERING);
+ }
+ break;
+ case "MT":
+ position.set(Position.KEY_MOTION, Integer.parseInt(values[i]) > 0);
break;
default:
break;