diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2018-04-25 19:52:08 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2018-04-25 19:52:08 +1200 |
commit | c45005432548a3607e82f5645c498d20b3728857 (patch) | |
tree | 13bd567e189f085b0d3a6b321ef6e2836a6aa8cf /src | |
parent | 88afc092584d0c02e3c8a20684302c3748e050ea (diff) | |
download | traccar-server-c45005432548a3607e82f5645c498d20b3728857.tar.gz traccar-server-c45005432548a3607e82f5645c498d20b3728857.tar.bz2 traccar-server-c45005432548a3607e82f5645c498d20b3728857.zip |
Fix Gator UDP response
Diffstat (limited to 'src')
-rw-r--r-- | src/org/traccar/protocol/GatorProtocolDecoder.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/org/traccar/protocol/GatorProtocolDecoder.java b/src/org/traccar/protocol/GatorProtocolDecoder.java index 9cd746f51..b38214457 100644 --- a/src/org/traccar/protocol/GatorProtocolDecoder.java +++ b/src/org/traccar/protocol/GatorProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 - 2017 Anton Tananaev (anton@traccar.org) + * Copyright 2013 - 2018 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -56,7 +56,7 @@ public class GatorProtocolDecoder extends BaseProtocolDecoder { return String.format("%02d%02d%02d%02d%02d", d1, d2, d3, d4, d5); } - private void sendResponse(Channel channel, byte calibration) { + private void sendResponse(Channel channel, SocketAddress remoteAddress, byte calibration) { if (channel != null) { ChannelBuffer response = ChannelBuffers.dynamicBuffer(); response.writeByte(0x24); response.writeByte(0x24); // header @@ -67,7 +67,7 @@ public class GatorProtocolDecoder extends BaseProtocolDecoder { response.writeByte(0); // slave order response.writeByte(1); // calibration response.writeByte(0x0D); - channel.write(response); + channel.write(response, remoteAddress); } } @@ -85,7 +85,7 @@ public class GatorProtocolDecoder extends BaseProtocolDecoder { buf.readUnsignedByte(), buf.readUnsignedByte(), buf.readUnsignedByte(), buf.readUnsignedByte()); - sendResponse(channel, buf.getByte(buf.writerIndex() - 2)); + sendResponse(channel, remoteAddress, buf.getByte(buf.writerIndex() - 2)); if (type == MSG_POSITION_DATA || type == MSG_ROLLCALL_RESPONSE || type == MSG_ALARM_DATA || type == MSG_BLIND_AREA) { |