diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2018-06-08 11:07:43 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2018-06-08 11:07:43 +1200 |
commit | 4d9187e2ee98eee17d4adbcb84379e2c68fe2bcd (patch) | |
tree | 0751e189301c050e3a66ef25326190ea54fc7f92 /src/org/traccar/protocol/LaipacProtocolDecoder.java | |
parent | e26b25c7c35cb99f3e0fb114bcedd76f090e0c3b (diff) | |
download | trackermap-server-4d9187e2ee98eee17d4adbcb84379e2c68fe2bcd.tar.gz trackermap-server-4d9187e2ee98eee17d4adbcb84379e2c68fe2bcd.tar.bz2 trackermap-server-4d9187e2ee98eee17d4adbcb84379e2c68fe2bcd.zip |
Migrate L, M, N protocols
Diffstat (limited to 'src/org/traccar/protocol/LaipacProtocolDecoder.java')
-rw-r--r-- | src/org/traccar/protocol/LaipacProtocolDecoder.java | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/org/traccar/protocol/LaipacProtocolDecoder.java b/src/org/traccar/protocol/LaipacProtocolDecoder.java index bfaff9ec4..8634a0e32 100644 --- a/src/org/traccar/protocol/LaipacProtocolDecoder.java +++ b/src/org/traccar/protocol/LaipacProtocolDecoder.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.Checksum; import org.traccar.helper.DateBuilder; import org.traccar.helper.Parser; @@ -93,7 +94,7 @@ public class LaipacProtocolDecoder extends BaseProtocolDecoder { String sentence = (String) msg; if (sentence.startsWith("$ECHK") && channel != null) { - channel.write(sentence + "\r\n"); // heartbeat + channel.writeAndFlush(new NetworkMessage(sentence + "\r\n", remoteAddress)); // heartbeat return null; } @@ -146,15 +147,15 @@ public class LaipacProtocolDecoder extends BaseProtocolDecoder { if (channel != null) { if (event.equals("3")) { - channel.write("$AVCFG,00000000,d*31\r\n"); + channel.writeAndFlush(new NetworkMessage("$AVCFG,00000000,d*31\r\n", remoteAddress)); } else if (event.equals("X") || event.equals("4")) { - channel.write("$AVCFG,00000000,x*2D\r\n"); + channel.writeAndFlush(new NetworkMessage("$AVCFG,00000000,x*2D\r\n", remoteAddress)); } else if (event.equals("Z")) { - channel.write("$AVCFG,00000000,z*2F\r\n"); + channel.writeAndFlush(new NetworkMessage("$AVCFG,00000000,z*2F\r\n", remoteAddress)); } else if (Character.isLowerCase(status.charAt(0))) { String response = "$EAVACK," + event + "," + checksum; response += Checksum.nmea(response) + "\r\n"; - channel.write(response); + channel.writeAndFlush(new NetworkMessage(response, remoteAddress)); } } |