From 479a2b6c938177d10c02ea3c4937d129de774776 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Fri, 5 Nov 2021 10:09:02 -0700 Subject: Relax regular expression (fix #4767) --- src/main/java/org/traccar/protocol/StartekProtocolDecoder.java | 1 + src/test/java/org/traccar/protocol/StartekProtocolDecoderTest.java | 3 +++ 2 files changed, 4 insertions(+) (limited to 'src') diff --git a/src/main/java/org/traccar/protocol/StartekProtocolDecoder.java b/src/main/java/org/traccar/protocol/StartekProtocolDecoder.java index 65d295dc3..042518cb2 100644 --- a/src/main/java/org/traccar/protocol/StartekProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/StartekProtocolDecoder.java @@ -80,6 +80,7 @@ public class StartekProtocolDecoder extends BaseProtocolDecoder { .expression("([^,]+)?,?") // temperature .groupEnd("?") .groupEnd("?") + .any() .compile(); private String decodeAlarm(int value) { diff --git a/src/test/java/org/traccar/protocol/StartekProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/StartekProtocolDecoderTest.java index 1fbe71988..5dd7059e2 100644 --- a/src/test/java/org/traccar/protocol/StartekProtocolDecoderTest.java +++ b/src/test/java/org/traccar/protocol/StartekProtocolDecoderTest.java @@ -11,6 +11,9 @@ public class StartekProtocolDecoderTest extends ProtocolTest { var decoder = new StartekProtocolDecoder(null); + verifyPosition(decoder, text( + "&&W149,865429043319537,000,0,,211103013512,A,22.679003,114.045085,16,1.1,0,271,76,109075,460|0|249F|000010C5,19,0000003E,00,00,0A57|0168|0000|0000,1,0100000C")); + verifyAttribute(decoder, text( "&&:23,860262050015424,129,OKA2"), Position.KEY_RESULT, "129,OK"); -- cgit v1.2.3