Skip to content

Commit

Permalink
Fix Fifotrack photo command
Browse files Browse the repository at this point in the history
  • Loading branch information
tananaev committed Apr 13, 2019
1 parent 826af65 commit a3269fd
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@ public FifotrackProtocolDecoder(Protocol protocol) {

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));
}
Expand Down

0 comments on commit a3269fd

Please sign in to comment.