diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2019-05-11 17:16:21 -0700 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2019-05-11 17:16:21 -0700 |
commit | 7ea54b294e59f7a47fea34496de4c053a586a14a (patch) | |
tree | 37ceb176fbecf8d37d59b1a60499717976b52732 /src/main/java/org/traccar/protocol/ItsProtocolDecoder.java | |
parent | 9256a86c91349f63759c7e7d14eaaf56abd567f3 (diff) | |
download | trackermap-server-7ea54b294e59f7a47fea34496de4c053a586a14a.tar.gz trackermap-server-7ea54b294e59f7a47fea34496de4c053a586a14a.tar.bz2 trackermap-server-7ea54b294e59f7a47fea34496de4c053a586a14a.zip |
Add ITS protocol commands
Diffstat (limited to 'src/main/java/org/traccar/protocol/ItsProtocolDecoder.java')
-rw-r--r-- | src/main/java/org/traccar/protocol/ItsProtocolDecoder.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main/java/org/traccar/protocol/ItsProtocolDecoder.java b/src/main/java/org/traccar/protocol/ItsProtocolDecoder.java index 313575f27..8c1b9b480 100644 --- a/src/main/java/org/traccar/protocol/ItsProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/ItsProtocolDecoder.java @@ -54,11 +54,11 @@ public class ItsProtocolDecoder extends BaseProtocolDecoder { .expression("(..),") // status .or() .expression("[^,]*,") // vehicle registration - .number("([01]),") // valid + .number("([01]),").optional() // valid .groupEnd() .number("(dd),?(dd),?(dddd),") // date (ddmmyyyy) .number("(dd),?(dd),?(dd),") // time (hhmmss) - .expression("([AV]),").optional() // valid + .expression("([01AV]),").optional() // valid .number("(d+.d+),([NS]),") // latitude .number("(d+.d+),([EW]),") // longitude .groupBegin() @@ -176,7 +176,7 @@ public class ItsProtocolDecoder extends BaseProtocolDecoder { } position.setTime(parser.nextDateTime(Parser.DateTimeFormat.DMY_HMS)); if (parser.hasNext()) { - position.setValid(parser.next().equals("A")); + position.setValid(parser.next().matches("[1A]")); } position.setLatitude(parser.nextCoordinate(Parser.CoordinateFormat.DEG_HEM)); position.setLongitude(parser.nextCoordinate(Parser.CoordinateFormat.DEG_HEM)); |