diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2019-03-21 19:14:36 -0700 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2019-03-21 19:14:36 -0700 |
commit | 411af91e648433486818f56e713de7278d40cbdb (patch) | |
tree | c54cc9f41a446cac880a6d8da0a59217656b2d6a /src | |
parent | 2df9790f222518b3497981f1655a240c0156a6f4 (diff) | |
download | traccar-server-411af91e648433486818f56e713de7278d40cbdb.tar.gz traccar-server-411af91e648433486818f56e713de7278d40cbdb.tar.bz2 traccar-server-411af91e648433486818f56e713de7278d40cbdb.zip |
Fix message response
Diffstat (limited to 'src')
-rw-r--r-- | src/org/traccar/protocol/T800xProtocolDecoder.java | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/org/traccar/protocol/T800xProtocolDecoder.java b/src/org/traccar/protocol/T800xProtocolDecoder.java index 9db5b22f0..5a8ba0751 100644 --- a/src/org/traccar/protocol/T800xProtocolDecoder.java +++ b/src/org/traccar/protocol/T800xProtocolDecoder.java @@ -45,13 +45,13 @@ public class T800xProtocolDecoder extends BaseProtocolDecoder { public static final int MSG_ALARM = 0x04; public static final int MSG_COMMAND = 0x81; - private void sendResponse(Channel channel, short header, int type, ByteBuf imei) { + private void sendResponse(Channel channel, short header, int type, int index, ByteBuf imei) { if (channel != null) { ByteBuf response = Unpooled.buffer(15); response.writeShort(header); response.writeByte(type); response.writeShort(response.capacity()); // length - response.writeShort(0x0001); // index + response.writeShort(index); response.writeBytes(imei); channel.writeAndFlush(new NetworkMessage(response, channel.remoteAddress())); } @@ -94,9 +94,7 @@ public class T800xProtocolDecoder extends BaseProtocolDecoder { return null; } - if (type == MSG_LOGIN || type == MSG_ALARM || type == MSG_HEARTBEAT) { - sendResponse(channel, header, type, imei); - } + sendResponse(channel, header, type, index, imei); if (type == MSG_GPS || type == MSG_ALARM) { |