aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2021-04-20 20:08:31 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2021-04-20 20:08:31 -0700
commit269d458f82d0a4e2fe6a657fa2761c5202452ec5 (patch)
treec423251769fd2c0749b59346bd83421be7772894
parentd1d3be228d270355c9d48ede69a6e3570d3710b7 (diff)
downloadtrackermap-server-269d458f82d0a4e2fe6a657fa2761c5202452ec5.tar.gz
trackermap-server-269d458f82d0a4e2fe6a657fa2761c5202452ec5.tar.bz2
trackermap-server-269d458f82d0a4e2fe6a657fa2761c5202452ec5.zip
Fix command length
-rw-r--r--src/main/java/org/traccar/protocol/StartekProtocolEncoder.java2
1 files changed, 1 insertions, 1 deletions
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";
}