diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2014-01-05 13:17:44 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2014-01-05 13:17:44 +1300 |
commit | 6575ff8587bb1507cab8847dd3f6e545a88ae225 (patch) | |
tree | a80db13c0b9ffef63435ee735c3b97bbb92111f1 /src | |
parent | d5be71c70bfb2ba608c2e0587d21ac6dc538ca4e (diff) | |
download | trackermap-server-6575ff8587bb1507cab8847dd3f6e545a88ae225.tar.gz trackermap-server-6575ff8587bb1507cab8847dd3f6e545a88ae225.tar.bz2 trackermap-server-6575ff8587bb1507cab8847dd3f6e545a88ae225.zip |
Fix H02 binary decoder
Diffstat (limited to 'src')
-rw-r--r-- | src/org/traccar/protocol/H02ProtocolDecoder.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/org/traccar/protocol/H02ProtocolDecoder.java b/src/org/traccar/protocol/H02ProtocolDecoder.java index cc59eea9d..f9a1decd6 100644 --- a/src/org/traccar/protocol/H02ProtocolDecoder.java +++ b/src/org/traccar/protocol/H02ProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2012 - 2013 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2012 - 2014 Anton Tananaev (anton.tananaev@gmail.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,7 +40,7 @@ public class H02ProtocolDecoder extends BaseProtocolDecoder { int degrees = ChannelBufferTools.readHexInteger(buf, 2); if (lon) { - degrees = degrees * 10 + (buf.getByte(buf.readerIndex()) >> 4); + degrees = degrees * 10 + (buf.getUnsignedByte(buf.readerIndex()) >> 4); } double result = 0; @@ -154,7 +154,7 @@ public class H02ProtocolDecoder extends BaseProtocolDecoder { time.set(Calendar.SECOND, Integer.valueOf(parser.group(index++))); // Validity - position.setValid(parser.group(index++).compareTo("A") == 0 ? true : false); + position.setValid(parser.group(index++).compareTo("A") == 0); // Latitude Double latitude = Double.valueOf(parser.group(index++)); |