aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-10-19 09:43:40 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2015-10-19 09:43:40 +1300
commitdbd6de7e462a6e9f52cba1168beeba5ce9773051 (patch)
tree1e9b9fec62fcdf1fa38c5b79a514e6741dbb3ad4 /src
parent30f97a3af0dab8724f6c4c3c32da25f1adbf4221 (diff)
downloadtraccar-server-dbd6de7e462a6e9f52cba1168beeba5ce9773051.tar.gz
traccar-server-dbd6de7e462a6e9f52cba1168beeba5ce9773051.tar.bz2
traccar-server-dbd6de7e462a6e9f52cba1168beeba5ce9773051.zip
Fix meiligao UDP responses
Diffstat (limited to 'src')
-rw-r--r--src/org/traccar/protocol/MeiligaoProtocolDecoder.java10
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: