Skip to content

Commit

Permalink
Send AT2000 track record request
Browse files Browse the repository at this point in the history
  • Loading branch information
tananaev committed Dec 30, 2016
1 parent b8abb12 commit 3d9499f
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/org/traccar/protocol/At2000ProtocolDecoder.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,16 @@ private static void sendResponse(Channel channel) {
}
}

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 {
Expand Down Expand Up @@ -128,6 +138,10 @@ protected Object decode(

sendResponse(channel);

if (type == MSG_DEVICE_ID) {
sendRequest(channel);
}

return null;
}

Expand Down

0 comments on commit 3d9499f

Please sign in to comment.