aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2017-03-18 10:56:46 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2017-03-18 10:56:46 +1300
commit8beecc6b90975c972ba76ffbb5a7c975de25530c (patch)
treebf51d20961b8ca87be146c2e1299da2babe5066a /src/org/traccar/protocol
parenta32c9c12179efef2db2e04e86da446e23b6284a3 (diff)
downloadtrackermap-server-8beecc6b90975c972ba76ffbb5a7c975de25530c.tar.gz
trackermap-server-8beecc6b90975c972ba76ffbb5a7c975de25530c.tar.bz2
trackermap-server-8beecc6b90975c972ba76ffbb5a7c975de25530c.zip
Add driver id for StarLink protocol
Diffstat (limited to 'src/org/traccar/protocol')
-rw-r--r--src/org/traccar/protocol/StarLinkProtocolDecoder.java8
1 files changed, 7 insertions, 1 deletions
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;
}