diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2019-07-06 21:56:56 -0700 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2019-07-06 21:56:56 -0700 |
commit | 830b117453b913802c52af25cf67e11a2e6d4ea9 (patch) | |
tree | 0e7fc5a063958383e197b3a4b9948abf352c28f6 | |
parent | a50bc86cb8be51423ad1b473bcab99c8bb298b0b (diff) | |
download | trackermap-server-830b117453b913802c52af25cf67e11a2e6d4ea9.tar.gz trackermap-server-830b117453b913802c52af25cf67e11a2e6d4ea9.tar.bz2 trackermap-server-830b117453b913802c52af25cf67e11a2e6d4ea9.zip |
Support comma-separated id
-rw-r--r-- | src/main/java/org/traccar/protocol/PluginProtocolDecoder.java | 4 | ||||
-rw-r--r-- | src/test/java/org/traccar/protocol/PluginProtocolDecoderTest.java | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/main/java/org/traccar/protocol/PluginProtocolDecoder.java b/src/main/java/org/traccar/protocol/PluginProtocolDecoder.java index 3f87a774b..106889ee0 100644 --- a/src/main/java/org/traccar/protocol/PluginProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/PluginProtocolDecoder.java @@ -34,8 +34,8 @@ public class PluginProtocolDecoder extends BaseProtocolDecoder { } private static final Pattern PATTERN = new PatternBuilder() - .expression("[^0-9]*") - .number("(d+),") // device id + .expression("[^0-9,]*,?") + .number("([^,]+),") // device id .number("(dddd)(dd)(dd)") // date (yyyymmdd) .number("(dd)(dd)(dd),") // time (hhmmss) .number("(-?d+.d+),") // longitude diff --git a/src/test/java/org/traccar/protocol/PluginProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/PluginProtocolDecoderTest.java index df102a066..582ed9a5a 100644 --- a/src/test/java/org/traccar/protocol/PluginProtocolDecoderTest.java +++ b/src/test/java/org/traccar/protocol/PluginProtocolDecoderTest.java @@ -11,6 +11,9 @@ public class PluginProtocolDecoderTest extends ProtocolTest { PluginProtocolDecoder decoder = new PluginProtocolDecoder(null); verifyPosition(decoder, text( + "$$STATUS,fleet40,20190704122622,26.259431,-29.027889,0,9,0,-1,2,19719,805315969,0,0,0")); + + verifyPosition(decoder, text( "$$ALARM801739,20190612121950,28.254067,-25.860494,0,0,0,-1,2,2,12595331,0,0,0,+,22,0,0,0,0,0,,0,0")); verifyPosition(decoder, text( |