From 5bced58f76ef64bab98c4ef5323860cee1c4bbec Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Fri, 19 Sep 2014 20:58:04 +1200 Subject: Fix GPS103 UDP mode (fix #863) --- src/org/traccar/protocol/Gps103ProtocolDecoder.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/org/traccar/protocol/Gps103ProtocolDecoder.java b/src/org/traccar/protocol/Gps103ProtocolDecoder.java index 72be07bb6..124df4377 100644 --- a/src/org/traccar/protocol/Gps103ProtocolDecoder.java +++ b/src/org/traccar/protocol/Gps103ProtocolDecoder.java @@ -15,6 +15,7 @@ */ package org.traccar.protocol; +import java.net.SocketAddress; import java.util.Calendar; import java.util.TimeZone; import java.util.regex.Matcher; @@ -58,7 +59,7 @@ public class Gps103ProtocolDecoder extends BaseProtocolDecoder { @Override protected Object decode( - ChannelHandlerContext ctx, Channel channel, Object msg) + ChannelHandlerContext ctx, Channel channel, SocketAddress remoteAddress, Object msg) throws Exception { String sentence = (String) msg; @@ -66,7 +67,7 @@ public class Gps103ProtocolDecoder extends BaseProtocolDecoder { // Send response #1 if (sentence.contains("##")) { if (channel != null) { - channel.write("LOAD"); + channel.write("LOAD", remoteAddress); } return null; } @@ -74,7 +75,7 @@ public class Gps103ProtocolDecoder extends BaseProtocolDecoder { // Send response #2 if (sentence.length() == 15 && Character.isDigit(sentence.charAt(0))) { if (channel != null) { - channel.write("ON"); + channel.write("ON", remoteAddress); } return null; } -- cgit v1.2.3