aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/traccar/protocol/PluginProtocolDecoder.java4
-rw-r--r--src/test/java/org/traccar/protocol/PluginProtocolDecoderTest.java3
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(