From 269d458f82d0a4e2fe6a657fa2761c5202452ec5 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Tue, 20 Apr 2021 20:08:31 -0700 Subject: Fix command length --- src/main/java/org/traccar/protocol/StartekProtocolEncoder.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/main/java/org/traccar/protocol/StartekProtocolEncoder.java b/src/main/java/org/traccar/protocol/StartekProtocolEncoder.java index a96502f11..300004c5e 100644 --- a/src/main/java/org/traccar/protocol/StartekProtocolEncoder.java +++ b/src/main/java/org/traccar/protocol/StartekProtocolEncoder.java @@ -31,7 +31,7 @@ public class StartekProtocolEncoder extends StringProtocolEncoder { protected String formatCommand(Command command, String format, String... keys) { String uniqueId = getUniqueId(command.getDeviceId()); String payload = super.formatCommand(command, format, keys); - int length = uniqueId.length() + 1 + payload.length(); + int length = 1 + uniqueId.length() + 1 + payload.length(); String sentence = "$$:" + length + "," + uniqueId + "," + payload; return sentence + Checksum.sum(sentence) + "\r\n"; } -- cgit v1.2.3