aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/TzoneProtocolDecoder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-10-20 13:59:44 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2015-10-20 13:59:44 +1300
commit06b5113f3d98a44530c2ade6810bc75092fccc31 (patch)
treecb8c03c8f3394db0691b73547e86d2a181462607 /src/org/traccar/protocol/TzoneProtocolDecoder.java
parent7b103b43754de283e423df03042c6f75307c8466 (diff)
downloadtrackermap-server-06b5113f3d98a44530c2ade6810bc75092fccc31.tar.gz
trackermap-server-06b5113f3d98a44530c2ade6810bc75092fccc31.tar.bz2
trackermap-server-06b5113f3d98a44530c2ade6810bc75092fccc31.zip
Refactor bit utililies class
Diffstat (limited to 'src/org/traccar/protocol/TzoneProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/TzoneProtocolDecoder.java5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/org/traccar/protocol/TzoneProtocolDecoder.java b/src/org/traccar/protocol/TzoneProtocolDecoder.java
index 1fe32af7a..8125f33cb 100644
--- a/src/org/traccar/protocol/TzoneProtocolDecoder.java
+++ b/src/org/traccar/protocol/TzoneProtocolDecoder.java
@@ -34,8 +34,7 @@ public class TzoneProtocolDecoder extends BaseProtocolDecoder {
@Override
protected Object decode(
- Channel channel, SocketAddress remoteAddress, Object msg)
- throws Exception {
+ Channel channel, SocketAddress remoteAddress, Object msg) throws Exception {
ChannelBuffer buf = (ChannelBuffer) msg;
@@ -87,7 +86,7 @@ public class TzoneProtocolDecoder extends BaseProtocolDecoder {
position.set(Event.KEY_ODOMETER, buf.readUnsignedMedium());
int flags = buf.readUnsignedShort();
- position.setCourse(BitUtil.range(flags, 0, 9));
+ position.setCourse(BitUtil.to(flags, 9));
position.setLatitude(BitUtil.check(flags, 10) ? lat : -lat);
position.setLongitude(BitUtil.check(flags, 9) ? -lon : lon);
position.setValid(BitUtil.check(flags, 11));