aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-11-11 10:41:20 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2015-11-11 10:41:20 +1300
commitf0de865dfdf1993a70a49c445f3184954e677f50 (patch)
tree92167b2f26ec2e754b67e22df1be93f29b2a3664 /src/org/traccar/protocol
parentb21ac014140a61bb23801b9d07679a83e2282d6b (diff)
downloadtraccar-server-f0de865dfdf1993a70a49c445f3184954e677f50.tar.gz
traccar-server-f0de865dfdf1993a70a49c445f3184954e677f50.tar.bz2
traccar-server-f0de865dfdf1993a70a49c445f3184954e677f50.zip
Add support for GV300 iButton
Diffstat (limited to 'src/org/traccar/protocol')
-rw-r--r--src/org/traccar/protocol/Gl200ProtocolDecoder.java13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/org/traccar/protocol/Gl200ProtocolDecoder.java b/src/org/traccar/protocol/Gl200ProtocolDecoder.java
index a0d8bd1b2..bf481667e 100644
--- a/src/org/traccar/protocol/Gl200ProtocolDecoder.java
+++ b/src/org/traccar/protocol/Gl200ProtocolDecoder.java
@@ -131,7 +131,9 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder {
protected Object decode(
Channel channel, SocketAddress remoteAddress, Object msg) throws Exception {
- Parser parser = new Parser(PATTERN_HEARTBEAT, (String) msg);
+ String sentence = (String) msg;
+
+ Parser parser = new Parser(PATTERN_HEARTBEAT, sentence);
if (parser.matches()) {
if (channel != null) {
channel.write("+SACK:GTHBD," + parser.next() + "," + parser.next() + "$", remoteAddress);
@@ -139,7 +141,7 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder {
return null;
}
- parser = new Parser(PATTERN_INF, (String) msg);
+ parser = new Parser(PATTERN_INF, sentence);
if (parser.matches()) {
Position position = new Position();
@@ -166,7 +168,7 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder {
return position;
}
- parser = new Parser(PATTERN, (String) msg);
+ parser = new Parser(PATTERN, sentence);
if (!parser.matches()) {
return null;
}
@@ -179,6 +181,11 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder {
}
position.setDeviceId(getDeviceId());
+ // RFID
+ if (sentence.startsWith("+RESP:GTIDA")) {
+ position.set(Event.KEY_RFID, sentence.split(",")[5]);
+ }
+
// OBD
position.set(Event.KEY_RPM, parser.next());
position.set(Event.KEY_OBD_SPEED, parser.next());