aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/protocol
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2019-04-12 22:31:00 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2019-04-12 22:31:00 -0700
commita3269fda8b77c6af0e810222dae4aff6faf1df3f (patch)
treedbb110605c9a372505792b27dc87ce46398337a3 /src/main/java/org/traccar/protocol
parent826af6579290e9c96a5958115a017297fa6d7f79 (diff)
downloadtrackermap-server-a3269fda8b77c6af0e810222dae4aff6faf1df3f.tar.gz
trackermap-server-a3269fda8b77c6af0e810222dae4aff6faf1df3f.tar.bz2
trackermap-server-a3269fda8b77c6af0e810222dae4aff6faf1df3f.zip
Fix Fifotrack photo command
Diffstat (limited to 'src/main/java/org/traccar/protocol')
-rw-r--r--src/main/java/org/traccar/protocol/FifotrackProtocolDecoder.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main/java/org/traccar/protocol/FifotrackProtocolDecoder.java b/src/main/java/org/traccar/protocol/FifotrackProtocolDecoder.java
index beaa34125..35696ee12 100644
--- a/src/main/java/org/traccar/protocol/FifotrackProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/FifotrackProtocolDecoder.java
@@ -97,9 +97,9 @@ public class FifotrackProtocolDecoder extends BaseProtocolDecoder {
private void requestPhoto(Channel channel, SocketAddress socketAddress, String imei, String file) {
if (channel != null) {
- String content = "D06," + file + "," + photo.writerIndex() + "," + Math.min(1024, photo.writableBytes());
- int length = 1 + imei.length() + 1 + content.length() + 5;
- String response = String.format("@@%02d,%s,%s*", length, imei, content);
+ String content = "1,D06," + file + "," + photo.writerIndex() + "," + Math.min(1024, photo.writableBytes());
+ int length = 1 + imei.length() + 1 + content.length();
+ String response = String.format("##%02d,%s,%s*", length, imei, content);
response += Checksum.sum(response) + "\r\n";
channel.writeAndFlush(new NetworkMessage(response, socketAddress));
}