From 60811fc34a6cc4f27f4a59f9e2df027268ada6c7 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Thu, 8 Oct 2020 14:28:54 -0700 Subject: Additional StarLink attributes --- src/main/java/org/traccar/protocol/StarLinkProtocolDecoder.java | 6 ++++++ src/test/java/org/traccar/protocol/StarLinkProtocolDecoderTest.java | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/src/main/java/org/traccar/protocol/StarLinkProtocolDecoder.java b/src/main/java/org/traccar/protocol/StarLinkProtocolDecoder.java index f791df0f3..155f26c5b 100644 --- a/src/main/java/org/traccar/protocol/StarLinkProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/StarLinkProtocolDecoder.java @@ -188,6 +188,9 @@ public class StarLinkProtocolDecoder extends BaseProtocolDecoder { cid = Integer.parseInt(data[i]); } break; + case "#CSS#": + position.set(Position.KEY_RSSI, Integer.parseInt(data[i])); + break; case "#VIN#": position.set(Position.KEY_POWER, Double.parseDouble(data[i])); break; @@ -203,6 +206,9 @@ public class StarLinkProtocolDecoder extends BaseProtocolDecoder { case "#ENG#": position.set("engine", data[i].equals("1")); break; + case "#SATU#": + position.set(Position.KEY_SATELLITES, Integer.parseInt(data[i])); + break; case "#TS1#": position.set("sensor1State", Integer.parseInt(data[i])); break; diff --git a/src/test/java/org/traccar/protocol/StarLinkProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/StarLinkProtocolDecoderTest.java index 114a352e6..1dd96d8ca 100644 --- a/src/test/java/org/traccar/protocol/StarLinkProtocolDecoderTest.java +++ b/src/test/java/org/traccar/protocol/StarLinkProtocolDecoderTest.java @@ -11,6 +11,12 @@ public class StarLinkProtocolDecoderTest extends ProtocolTest { StarLinkProtocolDecoder decoder = new StarLinkProtocolDecoder(null); + decoder.setFormat("#IMEI#,#EDT#,#PDT#,#LAT#,#LONG#,#SPD#,#IGN#,#ODO#,#DUR#,#TDUR#,#LAC#,#CID#,#VIN#,#VBAT#,#EID#,#EDSC#,#DRV#,#SATU#,#CSS#,#OUT1#,#OUT2#,#IN2#,#IND#"); + + verifyAttribute(decoder, text( + "$SLU351580050543640,06,101,351580050543640,200927184734,200927184724,+4222.4186,+00153.1426,000.0,0,000008,,582,21269,214241628,00.213,03.407,09,Lost Power,0,5,96,0,0,0,1,,,,,,,,,,,,*10"), + Position.KEY_RSSI, 96); + decoder.setFormat("#EDT#,#EID#,#PDT#,#LAT#,#LONG#,#SPD#,#HEAD#,#ODO#,#LAC#,#CID#,#VIN#,#VBAT#,#TI1#,#TS1#,#TV1#,#TH1#,#TD1#,#EDSC#,#TI2#,#TS2#,#TV2#,#TH2#,#TD2#"); verifyAttribute(decoder, text( -- cgit v1.2.3