aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2022-02-21 10:10:06 -0800
committerGitHub <noreply@github.com>2022-02-21 10:10:06 -0800
commit638e611d993e6016a1af544f9c86b3052da33e70 (patch)
tree52434e0ab1da544820240a1889cd8a92d8dd22fa
parent7d66054920a496399cb0e20f10556ae78c3ee009 (diff)
parent0f9923dc1dda589848d26ac19bfccbaabe3ca8b6 (diff)
downloadtrackermap-server-638e611d993e6016a1af544f9c86b3052da33e70.tar.gz
trackermap-server-638e611d993e6016a1af544f9c86b3052da33e70.tar.bz2
trackermap-server-638e611d993e6016a1af544f9c86b3052da33e70.zip
Merge pull request #4813 from 4alexbo/add-S1903-to-trv-protocol
Support YP14 from "1903" protocol specification
-rw-r--r--src/main/java/org/traccar/protocol/TrvProtocolDecoder.java4
-rw-r--r--src/test/java/org/traccar/protocol/TrvProtocolDecoderTest.java3
2 files changed, 5 insertions, 2 deletions
diff --git a/src/main/java/org/traccar/protocol/TrvProtocolDecoder.java b/src/main/java/org/traccar/protocol/TrvProtocolDecoder.java
index 05312b820..e62cdf404 100644
--- a/src/main/java/org/traccar/protocol/TrvProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/TrvProtocolDecoder.java
@@ -59,7 +59,7 @@ public class TrvProtocolDecoder extends BaseProtocolDecoder {
.number("(d)") // acc
.number("(dd)") // arm status
.number("(dd)") // working mode
- .number("(?:[0-2]{3})?,")
+ .number("(?:d{3,5})?,")
.number("(d+),") // mcc
.number("(d+),") // mnc
.number("(d+),") // lac
@@ -183,7 +183,7 @@ public class TrvProtocolDecoder extends BaseProtocolDecoder {
return position;
- } else if (type.equals("AP01") || type.equals("AP10") || type.equals("YP03")) {
+ } else if (type.equals("AP01") || type.equals("AP10") || type.equals("YP03") || type.equals("YP14")) {
Parser parser = new Parser(PATTERN, sentence);
if (!parser.matches()) {
diff --git a/src/test/java/org/traccar/protocol/TrvProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/TrvProtocolDecoderTest.java
index 44735abcb..33d4e0124 100644
--- a/src/test/java/org/traccar/protocol/TrvProtocolDecoderTest.java
+++ b/src/test/java/org/traccar/protocol/TrvProtocolDecoderTest.java
@@ -65,6 +65,9 @@ public class TrvProtocolDecoderTest extends ProtocolTest {
verifyPosition(decoder, text(
"TRVAP10080524A2232.9806N11404.9355E000.1061830323.8706000908000502,460,0,9520,3671,00,zh-cn,00"));
+ verifyPosition(decoder, text(
+ "TRVYP14220217A5235.7885N00724.1840E000.0130919177.561000050660000200004,262,01,14635,52789,FritzBox7|DC-39-8F-7E-94-73|-89&FritzBox7|24-4E-5D-71-C3-9C|-90&MY_IOT|80-B4-F7-77-9C-7C|-81&MYAP|44-D4-F7-77-9C-7C|-80#"));
+
}
}