aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/RoboTrackFrameDecoder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2018-06-08 23:57:59 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2018-06-08 23:57:59 +1200
commitfb543fb413652f4cb0408a6caafbdd7f4a4ca369 (patch)
treebda13c8001013f586ec7062608addf1b7e5a83ed /src/org/traccar/protocol/RoboTrackFrameDecoder.java
parentecb7bb33fcec52491f917dbc65a82990dcddb808 (diff)
downloadtrackermap-server-fb543fb413652f4cb0408a6caafbdd7f4a4ca369.tar.gz
trackermap-server-fb543fb413652f4cb0408a6caafbdd7f4a4ca369.tar.bz2
trackermap-server-fb543fb413652f4cb0408a6caafbdd7f4a4ca369.zip
Migrate R and S protocols
Diffstat (limited to 'src/org/traccar/protocol/RoboTrackFrameDecoder.java')
-rw-r--r--src/org/traccar/protocol/RoboTrackFrameDecoder.java16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/org/traccar/protocol/RoboTrackFrameDecoder.java b/src/org/traccar/protocol/RoboTrackFrameDecoder.java
index af215103c..297e221d6 100644
--- a/src/org/traccar/protocol/RoboTrackFrameDecoder.java
+++ b/src/org/traccar/protocol/RoboTrackFrameDecoder.java
@@ -15,14 +15,14 @@
*/
package org.traccar.protocol;
-import org.jboss.netty.buffer.ChannelBuffer;
-import org.jboss.netty.channel.Channel;
-import org.jboss.netty.channel.ChannelHandlerContext;
-import org.jboss.netty.handler.codec.frame.FrameDecoder;
+import io.netty.buffer.ByteBuf;
+import io.netty.channel.Channel;
+import io.netty.channel.ChannelHandlerContext;
+import org.traccar.BaseFrameDecoder;
-public class RoboTrackFrameDecoder extends FrameDecoder {
+public class RoboTrackFrameDecoder extends BaseFrameDecoder {
- private int messageLength(ChannelBuffer buf) {
+ private int messageLength(ByteBuf buf) {
switch ((int) buf.getByte(buf.readerIndex())) {
case RoboTrackProtocolDecoder.MSG_ID:
return 69;
@@ -33,7 +33,7 @@ public class RoboTrackFrameDecoder extends FrameDecoder {
case RoboTrackProtocolDecoder.MSG_IMAGE_START:
return 24;
case RoboTrackProtocolDecoder.MSG_IMAGE_DATA:
- return 8 + buf.getUnsignedShort(buf.readerIndex() + 1);
+ return 8 + buf.getUnsignedShortLE(buf.readerIndex() + 1);
case RoboTrackProtocolDecoder.MSG_IMAGE_END:
return 6;
default:
@@ -43,7 +43,7 @@ public class RoboTrackFrameDecoder extends FrameDecoder {
@Override
protected Object decode(
- ChannelHandlerContext ctx, Channel channel, ChannelBuffer buf) throws Exception {
+ ChannelHandlerContext ctx, Channel channel, ByteBuf buf) throws Exception {
int length = messageLength(buf);