From bac331ebf2a67d0bdc4f96c78f0dfbeb0c4b6da6 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sun, 15 May 2022 16:58:10 -0700 Subject: Handle Startek OBD issue --- src/main/java/org/traccar/protocol/StartekProtocolDecoder.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/main') diff --git a/src/main/java/org/traccar/protocol/StartekProtocolDecoder.java b/src/main/java/org/traccar/protocol/StartekProtocolDecoder.java index c1869def2..8a7b5cec7 100644 --- a/src/main/java/org/traccar/protocol/StartekProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/StartekProtocolDecoder.java @@ -42,7 +42,6 @@ public class StartekProtocolDecoder extends BaseProtocolDecoder { .number("d+,") // length .number("(d+),") // imei .expression("(.+)") // content - .number("xx") // checksum .compile(); private static final Pattern PATTERN_POSITION = new PatternBuilder() @@ -123,6 +122,9 @@ public class StartekProtocolDecoder extends BaseProtocolDecoder { } String content = parser.next(); + if (content.charAt(content.length() - 2 - 1) != '|') { + content = content.substring(0, content.length() - 2); + } if (content.length() < 100) { Position position = new Position(getProtocolName()); -- cgit v1.2.3