diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2021-04-20 20:08:31 -0700 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2021-04-20 20:08:31 -0700 |
commit | 269d458f82d0a4e2fe6a657fa2761c5202452ec5 (patch) | |
tree | c423251769fd2c0749b59346bd83421be7772894 /src | |
parent | d1d3be228d270355c9d48ede69a6e3570d3710b7 (diff) | |
download | traccar-server-269d458f82d0a4e2fe6a657fa2761c5202452ec5.tar.gz traccar-server-269d458f82d0a4e2fe6a657fa2761c5202452ec5.tar.bz2 traccar-server-269d458f82d0a4e2fe6a657fa2761c5202452ec5.zip |
Fix command length
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/org/traccar/protocol/StartekProtocolEncoder.java | 2 |
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"; } |