aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2021-09-08 22:26:27 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2021-09-08 22:26:27 -0700
commitf7b98d5ae86029361629c55d5b7ffc7dcdd0ed99 (patch)
tree4b7933b99cc8d8a2e1ac9c415b5a4f5aab1124fa
parente3c8872e2dcf0bd9affb138a8f827bfa7d42d6ac (diff)
downloadtrackermap-server-f7b98d5ae86029361629c55d5b7ffc7dcdd0ed99.tar.gz
trackermap-server-f7b98d5ae86029361629c55d5b7ffc7dcdd0ed99.tar.bz2
trackermap-server-f7b98d5ae86029361629c55d5b7ffc7dcdd0ed99.zip
Handle trailing comma
-rw-r--r--src/main/java/org/traccar/protocol/StartekProtocolDecoder.java2
-rw-r--r--src/test/java/org/traccar/protocol/StartekProtocolDecoderTest.java2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/main/java/org/traccar/protocol/StartekProtocolDecoder.java b/src/main/java/org/traccar/protocol/StartekProtocolDecoder.java
index b791e7bdd..65d295dc3 100644
--- a/src/main/java/org/traccar/protocol/StartekProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/StartekProtocolDecoder.java
@@ -77,7 +77,7 @@ public class StartekProtocolDecoder extends BaseProtocolDecoder {
.text(",")
.number("d,") // extended
.expression("([^,]+)?,") // fuel
- .expression("([^,]+)?") // temperature
+ .expression("([^,]+)?,?") // temperature
.groupEnd("?")
.groupEnd("?")
.compile();
diff --git a/src/test/java/org/traccar/protocol/StartekProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/StartekProtocolDecoderTest.java
index ace65ece6..1fbe71988 100644
--- a/src/test/java/org/traccar/protocol/StartekProtocolDecoderTest.java
+++ b/src/test/java/org/traccar/protocol/StartekProtocolDecoderTest.java
@@ -15,7 +15,7 @@ public class StartekProtocolDecoderTest extends ProtocolTest {
"&&:23,860262050015424,129,OKA2"),
Position.KEY_RESULT, "129,OK");
- verifyNull(decoder, text(
+ verifyPosition(decoder, text(
"&&X152,861157040151686,000,18,,210907163833,A,10.232715,-67.880423,11,1.4,0,275,437,34804,734|2|3EE4|00579406,28,00000015,00,00,0000|017D|0000|0000,1,010000,,9A"));
verifyPosition(decoder, text(