diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-10-19 09:43:40 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-10-19 09:43:40 +1300 |
commit | dbd6de7e462a6e9f52cba1168beeba5ce9773051 (patch) | |
tree | 1e9b9fec62fcdf1fa38c5b79a514e6741dbb3ad4 /src/org | |
parent | 30f97a3af0dab8724f6c4c3c32da25f1adbf4221 (diff) | |
download | traccar-server-dbd6de7e462a6e9f52cba1168beeba5ce9773051.tar.gz traccar-server-dbd6de7e462a6e9f52cba1168beeba5ce9773051.tar.bz2 traccar-server-dbd6de7e462a6e9f52cba1168beeba5ce9773051.zip |
Fix meiligao UDP responses
Diffstat (limited to 'src/org')
-rw-r--r-- | src/org/traccar/protocol/MeiligaoProtocolDecoder.java | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/org/traccar/protocol/MeiligaoProtocolDecoder.java b/src/org/traccar/protocol/MeiligaoProtocolDecoder.java index 7e2aa062d..a63554fc4 100644 --- a/src/org/traccar/protocol/MeiligaoProtocolDecoder.java +++ b/src/org/traccar/protocol/MeiligaoProtocolDecoder.java @@ -112,7 +112,7 @@ public class MeiligaoProtocolDecoder extends BaseProtocolDecoder { } private static void sendResponse( - Channel channel, ChannelBuffer id, int type, ChannelBuffer msg) { + Channel channel, SocketAddress remoteAddress, ChannelBuffer id, int type, ChannelBuffer msg) { if (channel != null) { ChannelBuffer buf = ChannelBuffers.buffer( @@ -128,7 +128,7 @@ public class MeiligaoProtocolDecoder extends BaseProtocolDecoder { buf.writeByte('\r'); buf.writeByte('\n'); - channel.write(buf); + channel.write(buf, remoteAddress); } } @@ -157,20 +157,20 @@ public class MeiligaoProtocolDecoder extends BaseProtocolDecoder { case MSG_LOGIN: if (channel != null) { response = ChannelBuffers.wrappedBuffer(new byte[] {0x01}); - sendResponse(channel, id, MSG_LOGIN_RESPONSE, response); + sendResponse(channel, remoteAddress, id, MSG_LOGIN_RESPONSE, response); } return null; case MSG_HEARTBEAT: if (channel != null) { response = ChannelBuffers.wrappedBuffer(new byte[] {0x01}); - sendResponse(channel, id, MSG_HEARTBEAT, response); + sendResponse(channel, remoteAddress, id, MSG_HEARTBEAT, response); } return null; case MSG_SERVER: if (channel != null) { response = ChannelBuffers.copiedBuffer( getMeiligaoServer(channel), Charset.defaultCharset()); - sendResponse(channel, id, MSG_SERVER, response); + sendResponse(channel, remoteAddress, id, MSG_SERVER, response); } return null; case MSG_POSITION: |