From dbd6de7e462a6e9f52cba1168beeba5ce9773051 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Mon, 19 Oct 2015 09:43:40 +1300 Subject: Fix meiligao UDP responses --- src/org/traccar/protocol/MeiligaoProtocolDecoder.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/org') 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: -- cgit v1.2.3