aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/WatchProtocolDecoder.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/protocol/WatchProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/WatchProtocolDecoder.java9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/org/traccar/protocol/WatchProtocolDecoder.java b/src/org/traccar/protocol/WatchProtocolDecoder.java
index a5bdb6d62..04da066c5 100644
--- a/src/org/traccar/protocol/WatchProtocolDecoder.java
+++ b/src/org/traccar/protocol/WatchProtocolDecoder.java
@@ -20,6 +20,7 @@ import io.netty.channel.Channel;
import org.traccar.BaseProtocolDecoder;
import org.traccar.Context;
import org.traccar.DeviceSession;
+import org.traccar.NetworkMessage;
import org.traccar.helper.BitUtil;
import org.traccar.helper.Parser;
import org.traccar.helper.PatternBuilder;
@@ -63,11 +64,11 @@ public class WatchProtocolDecoder extends BaseProtocolDecoder {
private void sendResponse(Channel channel, String id, String index, String content) {
if (channel != null) {
if (index != null) {
- channel.write(String.format(
- "[%s*%s*%s*%04x*%s]", manufacturer, id, index, content.length(), content));
+ channel.writeAndFlush(new NetworkMessage(String.format("[%s*%s*%s*%04x*%s]",
+ manufacturer, id, index, content.length(), content), channel.remoteAddress()));
} else {
- channel.write(String.format(
- "[%s*%s*%04x*%s]", manufacturer, id, content.length(), content));
+ channel.writeAndFlush(new NetworkMessage(String.format("[%s*%s*%04x*%s]",
+ manufacturer, id, content.length(), content), channel.remoteAddress()));
}
}
}