diff options
-rw-r--r-- | src/org/traccar/protocol/TaipProtocol.java | 4 | ||||
-rw-r--r-- | src/org/traccar/protocol/TaipProtocolDecoder.java | 9 |
2 files changed, 5 insertions, 8 deletions
diff --git a/src/org/traccar/protocol/TaipProtocol.java b/src/org/traccar/protocol/TaipProtocol.java index c3d934c04..cbfc44122 100644 --- a/src/org/traccar/protocol/TaipProtocol.java +++ b/src/org/traccar/protocol/TaipProtocol.java @@ -40,7 +40,7 @@ public class TaipProtocol extends BaseProtocol { pipeline.addLast("frameDecoder", new CharacterDelimiterFrameDecoder(1024, '<')); pipeline.addLast("stringDecoder", new StringDecoder()); pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new TaipProtocolDecoder(TaipProtocol.this, true)); + pipeline.addLast("objectDecoder", new TaipProtocolDecoder(TaipProtocol.this)); } }); serverList.add(new TrackerServer(new ConnectionlessBootstrap(), getName()) { @@ -48,7 +48,7 @@ public class TaipProtocol extends BaseProtocol { protected void addSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("stringDecoder", new StringDecoder()); pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("objectDecoder", new TaipProtocolDecoder(TaipProtocol.this, false)); + pipeline.addLast("objectDecoder", new TaipProtocolDecoder(TaipProtocol.this)); } }); } diff --git a/src/org/traccar/protocol/TaipProtocolDecoder.java b/src/org/traccar/protocol/TaipProtocolDecoder.java index 34e7c6351..0309147b8 100644 --- a/src/org/traccar/protocol/TaipProtocolDecoder.java +++ b/src/org/traccar/protocol/TaipProtocolDecoder.java @@ -32,11 +32,8 @@ import java.util.regex.Pattern; public class TaipProtocolDecoder extends BaseProtocolDecoder { - private final boolean sendResponse; - public TaipProtocolDecoder(TaipProtocol protocol, boolean sendResponse) { super(protocol); - this.sendResponse = sendResponse; } private static final Pattern PATTERN = new PatternBuilder() @@ -197,13 +194,13 @@ public class TaipProtocolDecoder extends BaseProtocolDecoder { } if (deviceSession != null) { - if (sendResponse && channel != null) { + if (channel != null) { if (messageIndex != null) { String response = ">ACK;" + messageIndex + ";ID=" + uniqueId + ";*"; response += String.format("%02X", Checksum.xor(response)) + "<"; - channel.write(response); + channel.write(response, remoteAddress); } else { - channel.write(uniqueId); + channel.write(uniqueId, remoteAddress); } } |