aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/NavisProtocolDecoder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2018-06-09 15:51:11 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2018-06-09 15:51:11 +1200
commit5cf987a9e9cab3e9ec3d2a8acc335a85f2637df0 (patch)
treee290b09c50900b4700ac244827c337ff0fc3450c /src/org/traccar/protocol/NavisProtocolDecoder.java
parentc40928cd674144fa5ed3dc7306c33b16823b2fad (diff)
downloadtrackermap-server-5cf987a9e9cab3e9ec3d2a8acc335a85f2637df0.tar.gz
trackermap-server-5cf987a9e9cab3e9ec3d2a8acc335a85f2637df0.tar.bz2
trackermap-server-5cf987a9e9cab3e9ec3d2a8acc335a85f2637df0.zip
Fix various issues
Diffstat (limited to 'src/org/traccar/protocol/NavisProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/NavisProtocolDecoder.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/org/traccar/protocol/NavisProtocolDecoder.java b/src/org/traccar/protocol/NavisProtocolDecoder.java
index 37001c35b..dac8f7ba3 100644
--- a/src/org/traccar/protocol/NavisProtocolDecoder.java
+++ b/src/org/traccar/protocol/NavisProtocolDecoder.java
@@ -183,7 +183,7 @@ public class NavisProtocolDecoder extends BaseProtocolDecoder {
ParseResult result = parsePosition(deviceSession, buf);
ByteBuf response = Unpooled.buffer(8);
- response.writeBytes(Unpooled.copiedBuffer("*<T", StandardCharsets.US_ASCII));
+ response.writeCharSequence("*<T", StandardCharsets.US_ASCII);
response.writeIntLE((int) result.getId());
sendReply(channel, response);
@@ -206,7 +206,7 @@ public class NavisProtocolDecoder extends BaseProtocolDecoder {
}
ByteBuf response = Unpooled.buffer(8);
- response.writeBytes(Unpooled.copiedBuffer("*<A", StandardCharsets.US_ASCII));
+ response.writeCharSequence("*<A", StandardCharsets.US_ASCII);
response.writeByte(count);
sendReply(channel, response);
@@ -235,7 +235,7 @@ public class NavisProtocolDecoder extends BaseProtocolDecoder {
private void sendReply(Channel channel, ByteBuf data) {
ByteBuf header = Unpooled.buffer(16);
- header.writeBytes(Unpooled.copiedBuffer(prefix, StandardCharsets.US_ASCII));
+ header.writeCharSequence(prefix, StandardCharsets.US_ASCII);
header.writeIntLE((int) deviceUniqueId);
header.writeIntLE((int) serverId);
header.writeShortLE(data.readableBytes());
@@ -243,7 +243,7 @@ public class NavisProtocolDecoder extends BaseProtocolDecoder {
header.writeByte(checksum(header));
if (channel != null) {
- channel.writeAndFlush(new NetworkMessage(Unpooled.copiedBuffer(header, data), channel.remoteAddress()));
+ channel.writeAndFlush(new NetworkMessage(Unpooled.wrappedBuffer(header, data), channel.remoteAddress()));
}
}