aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/KhdProtocolEncoder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2018-06-07 16:48:41 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2018-06-07 16:48:41 +1200
commit7e324a9dfb2bcde08d1524a9f3dc5114c0d49bdc (patch)
tree0e5cba2fe3cc600478fb5f536e9abf485ef976d7 /src/org/traccar/protocol/KhdProtocolEncoder.java
parenta9be10be1cf3709a6f6eb5d612c2f5485f12749e (diff)
downloadtrackermap-server-7e324a9dfb2bcde08d1524a9f3dc5114c0d49bdc.tar.gz
trackermap-server-7e324a9dfb2bcde08d1524a9f3dc5114c0d49bdc.tar.bz2
trackermap-server-7e324a9dfb2bcde08d1524a9f3dc5114c0d49bdc.zip
Migrate H, I, J, K protocols
Diffstat (limited to 'src/org/traccar/protocol/KhdProtocolEncoder.java')
-rw-r--r--src/org/traccar/protocol/KhdProtocolEncoder.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/org/traccar/protocol/KhdProtocolEncoder.java b/src/org/traccar/protocol/KhdProtocolEncoder.java
index cb26c757a..9c0f0b67a 100644
--- a/src/org/traccar/protocol/KhdProtocolEncoder.java
+++ b/src/org/traccar/protocol/KhdProtocolEncoder.java
@@ -15,8 +15,8 @@
*/
package org.traccar.protocol;
-import org.jboss.netty.buffer.ChannelBuffer;
-import org.jboss.netty.buffer.ChannelBuffers;
+import io.netty.buffer.ByteBuf;
+import io.netty.buffer.Unpooled;
import org.traccar.BaseProtocolEncoder;
import org.traccar.helper.Checksum;
import org.traccar.helper.Log;
@@ -27,9 +27,9 @@ public class KhdProtocolEncoder extends BaseProtocolEncoder {
public static final int MSG_CUT_OIL = 0x39;
public static final int MSG_RESUME_OIL = 0x38;
- private ChannelBuffer encodeCommand(int command, String uniqueId) {
+ private ByteBuf encodeCommand(int command, String uniqueId) {
- ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
+ ByteBuf buf = Unpooled.buffer();
buf.writeByte(0x29);
buf.writeByte(0x29);
@@ -44,7 +44,7 @@ public class KhdProtocolEncoder extends BaseProtocolEncoder {
buf.writeByte(Integer.parseInt(uniqueId.substring(4, 6)) + 0x80);
buf.writeByte(Integer.parseInt(uniqueId.substring(6, 8)));
- buf.writeByte(Checksum.xor(buf.toByteBuffer()));
+ buf.writeByte(Checksum.xor(buf.nioBuffer()));
buf.writeByte(0x0D); // ending
return buf;