diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2019-08-06 08:52:39 -0700 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2019-08-06 08:52:39 -0700 |
commit | 0a2f7b1f70329362d76c5c9d446bfdcd314cf7ec (patch) | |
tree | 7321258ad62deec456ddff1831504929bef812b6 /src/main/java/org/traccar/protocol | |
parent | 12341a04c3c3bd0fe9b0d5d832ee6702bdbd7e18 (diff) | |
download | traccar-server-0a2f7b1f70329362d76c5c9d446bfdcd314cf7ec.tar.gz traccar-server-0a2f7b1f70329362d76c5c9d446bfdcd314cf7ec.tar.bz2 traccar-server-0a2f7b1f70329362d76c5c9d446bfdcd314cf7ec.zip |
Support VT33S protocol
Diffstat (limited to 'src/main/java/org/traccar/protocol')
-rw-r--r-- | src/main/java/org/traccar/protocol/TrvProtocolDecoder.java | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/main/java/org/traccar/protocol/TrvProtocolDecoder.java b/src/main/java/org/traccar/protocol/TrvProtocolDecoder.java index b63385187..eca9aca66 100644 --- a/src/main/java/org/traccar/protocol/TrvProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/TrvProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 - 2018 Anton Tananaev (anton@traccar.org) + * Copyright 2015 - 2019 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -42,7 +42,8 @@ public class TrvProtocolDecoder extends BaseProtocolDecoder { private static final Pattern PATTERN = new PatternBuilder() .expression("[A-Z]{2,3}") - .number("APdd") + .expression("[A-Z]P") + .number("dd") .number("(dd)(dd)(dd)") // date (yymmdd) .expression("([AV])") // validity .number("(dd)(dd.d+)") // latitude @@ -57,7 +58,8 @@ public class TrvProtocolDecoder extends BaseProtocolDecoder { .number("(ddd)") // battery .number("(d)") // acc .number("(dd)") // arm status - .number("(dd),") // working mode + .number("(dd)") // working mode + .number("(?:[0-2]{3})?,") .number("(d+),") // mcc .number("(d+),") // mnc .number("(d+),") // lac @@ -181,7 +183,9 @@ public class TrvProtocolDecoder extends BaseProtocolDecoder { return position; - } else if (type.equals("AP01") || type.equals("AP10")) { + } else if (type.equals("AP01") || type.equals("AP10") || type.equals("YP03")) { + org.traccar.helper.PatternUtil.MatchResult matchResult = + org.traccar.helper.PatternUtil.checkPattern(PATTERN.pattern(), (String) msg); Parser parser = new Parser(PATTERN, sentence); if (!parser.matches()) { |