aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/PricolProtocolDecoder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2018-06-08 21:00:31 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2018-06-08 21:00:31 +1200
commitecb7bb33fcec52491f917dbc65a82990dcddb808 (patch)
tree1d47e8310a7e7eabad06d40548c941a6e237da20 /src/org/traccar/protocol/PricolProtocolDecoder.java
parent4d9187e2ee98eee17d4adbcb84379e2c68fe2bcd (diff)
downloadtrackermap-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/PricolProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/PricolProtocolDecoder.java13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/org/traccar/protocol/PricolProtocolDecoder.java b/src/org/traccar/protocol/PricolProtocolDecoder.java
index 577665dcc..901639501 100644
--- a/src/org/traccar/protocol/PricolProtocolDecoder.java
+++ b/src/org/traccar/protocol/PricolProtocolDecoder.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2017 Anton Tananaev (anton@traccar.org)
+ * Copyright 2017 - 2018 Anton Tananaev (anton@traccar.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,11 +15,12 @@
*/
package org.traccar.protocol;
-import org.jboss.netty.buffer.ChannelBuffer;
-import org.jboss.netty.buffer.ChannelBuffers;
-import org.jboss.netty.channel.Channel;
+import io.netty.buffer.ByteBuf;
+import io.netty.buffer.Unpooled;
+import io.netty.channel.Channel;
import org.traccar.BaseProtocolDecoder;
import org.traccar.DeviceSession;
+import org.traccar.NetworkMessage;
import org.traccar.helper.DateBuilder;
import org.traccar.helper.UnitsConverter;
import org.traccar.model.Position;
@@ -37,7 +38,7 @@ public class PricolProtocolDecoder extends BaseProtocolDecoder {
protected Object decode(
Channel channel, SocketAddress remoteAddress, Object msg) throws Exception {
- ChannelBuffer buf = (ChannelBuffer) msg;
+ ByteBuf buf = (ByteBuf) msg;
buf.readUnsignedByte(); // header
@@ -86,7 +87,7 @@ public class PricolProtocolDecoder extends BaseProtocolDecoder {
position.set(Position.KEY_RPM, buf.readUnsignedShort());
if (channel != null) {
- channel.write(ChannelBuffers.copiedBuffer("ACK", StandardCharsets.US_ASCII), remoteAddress);
+ channel.write(new NetworkMessage(Unpooled.copiedBuffer("ACK", StandardCharsets.US_ASCII), remoteAddress));
}
return position;