From 8beecc6b90975c972ba76ffbb5a7c975de25530c Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 18 Mar 2017 10:56:46 +1300 Subject: Add driver id for StarLink protocol --- src/org/traccar/protocol/StarLinkProtocolDecoder.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/org/traccar/protocol/StarLinkProtocolDecoder.java b/src/org/traccar/protocol/StarLinkProtocolDecoder.java index da293f022..eaee07870 100644 --- a/src/org/traccar/protocol/StarLinkProtocolDecoder.java +++ b/src/org/traccar/protocol/StarLinkProtocolDecoder.java @@ -96,6 +96,7 @@ public class StarLinkProtocolDecoder extends BaseProtocolDecoder { String[] data = parser.next().split(","); Integer lac = null, cid = null; + int event = 0; for (int i = 0; i < Math.min(data.length, dataTags.length); i++) { switch (dataTags[i]) { @@ -103,7 +104,8 @@ public class StarLinkProtocolDecoder extends BaseProtocolDecoder { position.setDeviceTime(dateFormat.parse(data[i])); break; case "#EID#": - position.set(Position.KEY_EVENT, data[i]); + event = Integer.parseInt(data[i]); + position.set(Position.KEY_EVENT, event); break; case "#PDT#": position.setFixTime(dateFormat.parse(data[i])); @@ -177,6 +179,10 @@ public class StarLinkProtocolDecoder extends BaseProtocolDecoder { position.setNetwork(new Network(CellTower.fromLacCid(lac, cid))); } + if (event == 20) { + position.set(Position.KEY_RFID, data[data.length - 1]); + } + return position; } -- cgit v1.2.3