aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-12-30 22:30:38 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2016-12-30 22:30:54 +1300
commit3d9499fab03dc616d060c00047ec24a6163ea2fa (patch)
tree50af6a3aaf75e75586f29a45b494545b363c720d
parentb8abb12f380426dd4e34a0ad248581cea11fe95e (diff)
downloadtrackermap-server-3d9499fab03dc616d060c00047ec24a6163ea2fa.tar.gz
trackermap-server-3d9499fab03dc616d060c00047ec24a6163ea2fa.tar.bz2
trackermap-server-3d9499fab03dc616d060c00047ec24a6163ea2fa.zip
Send AT2000 track record request
-rw-r--r--src/org/traccar/protocol/At2000ProtocolDecoder.java14
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;
}