diff options
-rw-r--r-- | src/org/traccar/protocol/At2000ProtocolDecoder.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/org/traccar/protocol/At2000ProtocolDecoder.java b/src/org/traccar/protocol/At2000ProtocolDecoder.java index e9c26d406..989e0d136 100644 --- a/src/org/traccar/protocol/At2000ProtocolDecoder.java +++ b/src/org/traccar/protocol/At2000ProtocolDecoder.java @@ -59,6 +59,16 @@ public class At2000ProtocolDecoder extends BaseProtocolDecoder { } } + private static void sendRequest(Channel channel) { + if (channel != null) { + ChannelBuffer response = ChannelBuffers.directBuffer(ByteOrder.LITTLE_ENDIAN, BLOCK_LENGTH); + response.writeByte(MSG_TRACK_REQUEST); + response.writeMedium(ChannelBuffers.swapMedium(0)); + response.writerIndex(BLOCK_LENGTH); + channel.write(response); + } + } + @Override protected Object decode( Channel channel, SocketAddress remoteAddress, Object msg) throws Exception { @@ -128,6 +138,10 @@ public class At2000ProtocolDecoder extends BaseProtocolDecoder { sendResponse(channel); + if (type == MSG_DEVICE_ID) { + sendRequest(channel); + } + return null; } |