aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2017-03-29 00:44:06 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2017-03-29 00:44:07 +1300
commitb7d5d53ead8eb8f7dbe6e04cdee76ea2c05c1dbe (patch)
tree8c6dacc48183ab72a444c2a8f47fd49b812c3c77 /src
parent06b40d5341c846716bd0217e42df7031f460989c (diff)
downloadtraccar-server-b7d5d53ead8eb8f7dbe6e04cdee76ea2c05c1dbe.tar.gz
traccar-server-b7d5d53ead8eb8f7dbe6e04cdee76ea2c05c1dbe.tar.bz2
traccar-server-b7d5d53ead8eb8f7dbe6e04cdee76ea2c05c1dbe.zip
Add support for TAIP event code
Diffstat (limited to 'src')
-rw-r--r--src/org/traccar/protocol/TaipProtocolDecoder.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/org/traccar/protocol/TaipProtocolDecoder.java b/src/org/traccar/protocol/TaipProtocolDecoder.java
index a46cdefe3..34e7c6351 100644
--- a/src/org/traccar/protocol/TaipProtocolDecoder.java
+++ b/src/org/traccar/protocol/TaipProtocolDecoder.java
@@ -43,14 +43,14 @@ public class TaipProtocolDecoder extends BaseProtocolDecoder {
.groupBegin()
.expression("R[EP]V") // type
.groupBegin()
- .number("dd") // event index
+ .number("(dd)") // event
.number("(dddd)") // week
.number("(d)") // day
.groupEnd("?")
.number("(d{5})") // seconds
.or()
.expression("(?:RGP|RCQ|RBR)") // type
- .number("(?:dd)?")
+ .number("(dd)?") // event
.number("(dd)(dd)(dd)") // date (mmddyy)
.number("(dd)(dd)(dd)") // time (hhmmss)
.groupEnd()
@@ -107,12 +107,17 @@ public class TaipProtocolDecoder extends BaseProtocolDecoder {
Position position = new Position();
position.setProtocol(getProtocolName());
- if (parser.hasNext(2)) {
+ if (parser.hasNext(3)) {
+ position.set(Position.KEY_EVENT, parser.nextInt());
position.setTime(getTime(parser.nextInt(), parser.nextInt(), parser.nextInt()));
} else if (parser.hasNext()) {
position.setTime(getTime(parser.nextInt()));
}
+ if (parser.hasNext()) {
+ position.set(Position.KEY_EVENT, parser.nextInt());
+ }
+
if (parser.hasNext(6)) {
position.setTime(parser.nextDateTime(Parser.DateTimeFormat.DMY_HMS));
}