aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/NavisProtocolDecoder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-10-13 13:55:44 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2015-10-13 13:55:44 +1300
commit32d3fe2239886c4b75c93fcb344721113104ebec (patch)
treefb23ad5fcc7d47cccf313c736bdaf9332bdabdcd /src/org/traccar/protocol/NavisProtocolDecoder.java
parentf49790953e6f9c3f9aa88564caf72a3bf002a801 (diff)
downloadtrackermap-server-32d3fe2239886c4b75c93fcb344721113104ebec.tar.gz
trackermap-server-32d3fe2239886c4b75c93fcb344721113104ebec.tar.bz2
trackermap-server-32d3fe2239886c4b75c93fcb344721113104ebec.zip
Fix some more style issues
Diffstat (limited to 'src/org/traccar/protocol/NavisProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/NavisProtocolDecoder.java14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/org/traccar/protocol/NavisProtocolDecoder.java b/src/org/traccar/protocol/NavisProtocolDecoder.java
index a4b900f96..39912e420 100644
--- a/src/org/traccar/protocol/NavisProtocolDecoder.java
+++ b/src/org/traccar/protocol/NavisProtocolDecoder.java
@@ -34,7 +34,7 @@ public class NavisProtocolDecoder extends BaseProtocolDecoder {
private String prefix;
private long deviceUniqueId, serverId;
- private static final Charset charset = Charset.defaultCharset();
+ private static final Charset CHARSET = Charset.defaultCharset();
public NavisProtocolDecoder(NavisProtocol protocol) {
super(protocol);
@@ -212,7 +212,7 @@ public class NavisProtocolDecoder extends BaseProtocolDecoder {
ParseResult result = parsePosition(buf);
ChannelBuffer response = ChannelBuffers.dynamicBuffer(ByteOrder.LITTLE_ENDIAN, 8);
- response.writeBytes(ChannelBuffers.copiedBuffer(ByteOrder.LITTLE_ENDIAN, "*<T", charset));
+ response.writeBytes(ChannelBuffers.copiedBuffer(ByteOrder.LITTLE_ENDIAN, "*<T", CHARSET));
response.writeInt((int) result.getId());
sendReply(channel, response);
@@ -236,7 +236,7 @@ public class NavisProtocolDecoder extends BaseProtocolDecoder {
}
ChannelBuffer response = ChannelBuffers.dynamicBuffer(ByteOrder.LITTLE_ENDIAN, 8);
- response.writeBytes(ChannelBuffers.copiedBuffer(ByteOrder.LITTLE_ENDIAN, "*<A", charset));
+ response.writeBytes(ChannelBuffers.copiedBuffer(ByteOrder.LITTLE_ENDIAN, "*<A", CHARSET));
response.writeByte(count);
sendReply(channel, response);
@@ -251,7 +251,7 @@ public class NavisProtocolDecoder extends BaseProtocolDecoder {
private Object processHandshake(Channel channel, ChannelBuffer buf) {
buf.readByte(); // semicolon symbol
if (identify(buf.toString(Charset.defaultCharset()), channel)) {
- sendReply(channel, ChannelBuffers.copiedBuffer(ByteOrder.LITTLE_ENDIAN, "*<S", charset));
+ sendReply(channel, ChannelBuffers.copiedBuffer(ByteOrder.LITTLE_ENDIAN, "*<S", CHARSET));
}
return null;
}
@@ -266,7 +266,7 @@ public class NavisProtocolDecoder extends BaseProtocolDecoder {
private void sendReply(Channel channel, ChannelBuffer data) {
ChannelBuffer header = ChannelBuffers.directBuffer(ByteOrder.LITTLE_ENDIAN, 16);
- header.writeBytes(ChannelBuffers.copiedBuffer(ByteOrder.LITTLE_ENDIAN, prefix, charset));
+ header.writeBytes(ChannelBuffers.copiedBuffer(ByteOrder.LITTLE_ENDIAN, prefix, CHARSET));
header.writeInt((int) deviceUniqueId);
header.writeInt((int) serverId);
header.writeShort(data.readableBytes());
@@ -286,7 +286,7 @@ public class NavisProtocolDecoder extends BaseProtocolDecoder {
ChannelBuffer buf = (ChannelBuffer) msg;
// Read header
- prefix = buf.toString(buf.readerIndex(), 4, charset);
+ prefix = buf.toString(buf.readerIndex(), 4, CHARSET);
buf.skipBytes(prefix.length()); // prefix @NTC by default
serverId = buf.readUnsignedInt();
deviceUniqueId = buf.readUnsignedInt();
@@ -298,7 +298,7 @@ public class NavisProtocolDecoder extends BaseProtocolDecoder {
}
// Read message type
- String type = buf.toString(buf.readerIndex(), 3, charset);
+ String type = buf.toString(buf.readerIndex(), 3, CHARSET);
buf.skipBytes(type.length());
switch (type) {