aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/RuptelaProtocolDecoder.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/RuptelaProtocolDecoder.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/RuptelaProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/RuptelaProtocolDecoder.java20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/org/traccar/protocol/RuptelaProtocolDecoder.java b/src/org/traccar/protocol/RuptelaProtocolDecoder.java
index 7b11cc5c3..df3c89f8f 100644
--- a/src/org/traccar/protocol/RuptelaProtocolDecoder.java
+++ b/src/org/traccar/protocol/RuptelaProtocolDecoder.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2013 - 2017 Anton Tananaev (anton@traccar.org)
+ * Copyright 2013 - 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,9 +15,9 @@
*/
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.helper.DataConverter;
@@ -48,7 +48,7 @@ public class RuptelaProtocolDecoder extends BaseProtocolDecoder {
public static final int MSG_SET_IO = 17;
public static final int MSG_EXTENDED_RECORDS = 68;
- private Position decodeCommandResponse(DeviceSession deviceSession, int type, ChannelBuffer buf) {
+ private Position decodeCommandResponse(DeviceSession deviceSession, int type, ByteBuf buf) {
Position position = new Position(getProtocolName());
position.setDeviceId(deviceSession.getDeviceId());
@@ -73,7 +73,7 @@ public class RuptelaProtocolDecoder extends BaseProtocolDecoder {
}
}
- private long readValue(ChannelBuffer buf, int length, boolean signed) {
+ private long readValue(ByteBuf buf, int length, boolean signed) {
switch (length) {
case 1:
return signed ? buf.readByte() : buf.readUnsignedByte();
@@ -86,7 +86,7 @@ public class RuptelaProtocolDecoder extends BaseProtocolDecoder {
}
}
- private void decodeParameter(Position position, int id, ChannelBuffer buf, int length) {
+ private void decodeParameter(Position position, int id, ByteBuf buf, int length) {
switch (id) {
case 2:
case 3:
@@ -114,7 +114,7 @@ public class RuptelaProtocolDecoder extends BaseProtocolDecoder {
protected Object decode(
Channel channel, SocketAddress remoteAddress, Object msg) throws Exception {
- ChannelBuffer buf = (ChannelBuffer) msg;
+ ByteBuf buf = (ByteBuf) msg;
buf.readUnsignedShort(); // data length
@@ -196,7 +196,7 @@ public class RuptelaProtocolDecoder extends BaseProtocolDecoder {
}
if (channel != null) {
- channel.write(ChannelBuffers.wrappedBuffer(DataConverter.parseHex("0002640113bc")));
+ channel.write(Unpooled.wrappedBuffer(DataConverter.parseHex("0002640113bc")));
}
return positions;
@@ -229,7 +229,7 @@ public class RuptelaProtocolDecoder extends BaseProtocolDecoder {
}
if (channel != null) {
- channel.write(ChannelBuffers.wrappedBuffer(DataConverter.parseHex("00026d01c4a4")));
+ channel.write(Unpooled.wrappedBuffer(DataConverter.parseHex("00026d01c4a4")));
}
return positions;