diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2018-06-08 21:00:31 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2018-06-08 21:00:31 +1200 |
commit | ecb7bb33fcec52491f917dbc65a82990dcddb808 (patch) | |
tree | 1d47e8310a7e7eabad06d40548c941a6e237da20 /src/org/traccar/protocol/Pt60ProtocolDecoder.java | |
parent | 4d9187e2ee98eee17d4adbcb84379e2c68fe2bcd (diff) | |
download | trackermap-server-ecb7bb33fcec52491f917dbc65a82990dcddb808.tar.gz trackermap-server-ecb7bb33fcec52491f917dbc65a82990dcddb808.tar.bz2 trackermap-server-ecb7bb33fcec52491f917dbc65a82990dcddb808.zip |
Migrate O and P protocols
Diffstat (limited to 'src/org/traccar/protocol/Pt60ProtocolDecoder.java')
-rw-r--r-- | src/org/traccar/protocol/Pt60ProtocolDecoder.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/org/traccar/protocol/Pt60ProtocolDecoder.java b/src/org/traccar/protocol/Pt60ProtocolDecoder.java index 26f07a0a9..24dc72332 100644 --- a/src/org/traccar/protocol/Pt60ProtocolDecoder.java +++ b/src/org/traccar/protocol/Pt60ProtocolDecoder.java @@ -15,9 +15,10 @@ */ package org.traccar.protocol; -import org.jboss.netty.channel.Channel; +import io.netty.channel.Channel; import org.traccar.BaseProtocolDecoder; import org.traccar.DeviceSession; +import org.traccar.NetworkMessage; import org.traccar.helper.Parser; import org.traccar.helper.PatternBuilder; import org.traccar.model.Position; @@ -49,10 +50,10 @@ public class Pt60ProtocolDecoder extends BaseProtocolDecoder { .expression("(.*)") // data .compile(); - private void sendResponse(Channel channel) { + private void sendResponse(Channel channel, SocketAddress remoteAddress) { if (channel != null) { DateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss"); - channel.write("@G#@,V01,38," + dateFormat.format(new Date()) + ",@R#@"); + channel.write(new NetworkMessage("@G#@,V01,38," + dateFormat.format(new Date()) + ",@R#@", remoteAddress)); } } @@ -60,7 +61,7 @@ public class Pt60ProtocolDecoder extends BaseProtocolDecoder { protected Object decode( Channel channel, SocketAddress remoteAddress, Object msg) throws Exception { - sendResponse(channel); + sendResponse(channel, remoteAddress); Parser parser = new Parser(PATTERN, (String) msg); if (!parser.matches()) { |