aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2021-09-22 22:49:16 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2021-09-22 22:49:16 -0700
commitabf9f5f445bd2d460bf541ea0edb1bce339d2180 (patch)
tree019eb3243004e38f95bc0e4f14ad880eaf0e4ad6
parentc2ee0f4d9688de777b3f7cdf12ae486e22ae47ac (diff)
downloadtrackermap-server-abf9f5f445bd2d460bf541ea0edb1bce339d2180.tar.gz
trackermap-server-abf9f5f445bd2d460bf541ea0edb1bce339d2180.tar.bz2
trackermap-server-abf9f5f445bd2d460bf541ea0edb1bce339d2180.zip
More Starlink parameters
-rw-r--r--src/main/java/org/traccar/protocol/StarLinkProtocolDecoder.java33
1 files changed, 30 insertions, 3 deletions
diff --git a/src/main/java/org/traccar/protocol/StarLinkProtocolDecoder.java b/src/main/java/org/traccar/protocol/StarLinkProtocolDecoder.java
index 82f0e4061..7a6b6f4fe 100644
--- a/src/main/java/org/traccar/protocol/StarLinkProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/StarLinkProtocolDecoder.java
@@ -150,9 +150,21 @@ public class StarLinkProtocolDecoder extends BaseProtocolDecoder {
continue;
}
switch (dataTags[i]) {
+ case "#ALT#":
+ case "#ALTD#":
+ position.setAltitude(Double.parseDouble(data[i]));
+ break;
+ case "#DAL#":
+ case "#DID#":
+ position.set(Position.KEY_DRIVER_UNIQUE_ID, data[i]);
+ break;
case "#EDT#":
position.setDeviceTime(dateFormat.parse(data[i]));
break;
+ case "#EDV1#":
+ case "#EDV2#":
+ position.set("external" + dataTags[i].charAt(4), data[i]);
+ break;
case "#EID#":
event = Integer.parseInt(data[i]);
position.set(Position.KEY_ALARM, decodeAlarm(event));
@@ -166,6 +178,9 @@ public class StarLinkProtocolDecoder extends BaseProtocolDecoder {
case "#EDSC#":
position.set("reason", data[i]);
break;
+ case "#IARM#":
+ position.set(Position.KEY_ARMED, Integer.parseInt(data[i]) > 0);
+ break;
case "#PDT#":
position.setFixTime(dateFormat.parse(data[i]));
break;
@@ -185,11 +200,15 @@ public class StarLinkProtocolDecoder extends BaseProtocolDecoder {
position.setCourse(Integer.parseInt(data[i]));
break;
case "#ODO#":
+ case "#ODOD#":
position.set(Position.KEY_ODOMETER, (long) (Double.parseDouble(data[i]) * 1000));
break;
case "#BATC#":
position.set(Position.KEY_BATTERY_LEVEL, Integer.parseInt(data[i]));
break;
+ case "#BATH#":
+ position.set("batteryHealth", Integer.parseInt(data[i]));
+ break;
case "#TVI#":
position.set(Position.KEY_DEVICE_TEMP, Double.parseDouble(data[i]));
break;
@@ -217,6 +236,9 @@ public class StarLinkProtocolDecoder extends BaseProtocolDecoder {
case "#OUTD#":
position.set(Position.PREFIX_OUT + (dataTags[i].charAt(4) - 'A' + 1), Integer.parseInt(data[i]));
break;
+ case "#PDOP#":
+ position.set(Position.KEY_PDOP, Double.parseDouble(data[i]));
+ break;
case "#LAC#":
if (!data[i].isEmpty()) {
lac = Integer.parseInt(data[i]);
@@ -241,18 +263,23 @@ public class StarLinkProtocolDecoder extends BaseProtocolDecoder {
break;
case "#IGN#":
case "#IGNL#":
- position.set(Position.KEY_IGNITION, data[i].equals("1"));
- break;
case "#ENG#":
- position.set("engine", data[i].equals("1"));
+ position.set(Position.KEY_IGNITION, Integer.parseInt(data[i]) > 0);
break;
case "#DUR#":
case "#TDUR#":
position.set(Position.KEY_HOURS, Integer.parseInt(data[i]));
break;
+ case "#SAT#":
+ case "#SATN#":
+ position.set(Position.KEY_SATELLITES_VISIBLE, Integer.parseInt(data[i]));
+ break;
case "#SATU#":
position.set(Position.KEY_SATELLITES, Integer.parseInt(data[i]));
break;
+ case "#STRT#":
+ position.set("starter", Double.parseDouble(data[i]));
+ break;
case "#TS1#":
position.set("sensor1State", Integer.parseInt(data[i]));
break;