From 9f2f7d21fefda741cf9e3d4d43b3195902ed0a2b Mon Sep 17 00:00:00 2001 From: Ivan Muratov Date: Fri, 14 Jul 2017 09:39:58 +0300 Subject: Fix build issues. [ERROR] src/org/traccar/protocol/Arnavi4ProtocolDecoder.java:[81] (sizes) LineLength: Line is longer than 120 characters (found 121). --- src/org/traccar/protocol/Arnavi4ProtocolDecoder.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/org/traccar/protocol/Arnavi4ProtocolDecoder.java b/src/org/traccar/protocol/Arnavi4ProtocolDecoder.java index e2a1da29f..539f6d35c 100644 --- a/src/org/traccar/protocol/Arnavi4ProtocolDecoder.java +++ b/src/org/traccar/protocol/Arnavi4ProtocolDecoder.java @@ -78,7 +78,7 @@ public class Arnavi4ProtocolDecoder extends BaseProtocolDecoder { position.setCourse(buf.readUnsignedByte() * 2.0); position.setAltitude(buf.readUnsignedByte() * 10.0); byte satellites = buf.readByte(); - position.set(Position.KEY_SATELLITES, satellites & 0x0F + (satellites >> 4) & 0x0F); // gps + glonass + position.set(Position.KEY_SATELLITES, satellites & 0x0F + (satellites >> 4) & 0x0F); // gps+glonass position.setSpeed(buf.readByte() * 1.852); break; -- cgit v1.2.3 From 8684f83d352e01effbe08cacaccb264d4d368575 Mon Sep 17 00:00:00 2001 From: Ivan Muratov Date: Fri, 14 Jul 2017 09:48:16 +0300 Subject: Change signed byte to unsidned for tag value of movement speed. --- src/org/traccar/protocol/Arnavi4ProtocolDecoder.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/org/traccar/protocol/Arnavi4ProtocolDecoder.java b/src/org/traccar/protocol/Arnavi4ProtocolDecoder.java index 539f6d35c..4422ff4a6 100644 --- a/src/org/traccar/protocol/Arnavi4ProtocolDecoder.java +++ b/src/org/traccar/protocol/Arnavi4ProtocolDecoder.java @@ -79,7 +79,7 @@ public class Arnavi4ProtocolDecoder extends BaseProtocolDecoder { position.setAltitude(buf.readUnsignedByte() * 10.0); byte satellites = buf.readByte(); position.set(Position.KEY_SATELLITES, satellites & 0x0F + (satellites >> 4) & 0x0F); // gps+glonass - position.setSpeed(buf.readByte() * 1.852); + position.setSpeed(buf.readUnsignedByte() * 1.852); break; default: -- cgit v1.2.3 From fd1d75cb1a6dd1a4af065fec66ab69fcaf359916 Mon Sep 17 00:00:00 2001 From: Ivan Muratov Date: Fri, 14 Jul 2017 10:00:05 +0300 Subject: Add reading bytes from buffer for non-data packages. --- src/org/traccar/protocol/Arnavi4ProtocolDecoder.java | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/org/traccar/protocol/Arnavi4ProtocolDecoder.java b/src/org/traccar/protocol/Arnavi4ProtocolDecoder.java index 4422ff4a6..682fc1577 100644 --- a/src/org/traccar/protocol/Arnavi4ProtocolDecoder.java +++ b/src/org/traccar/protocol/Arnavi4ProtocolDecoder.java @@ -158,6 +158,8 @@ public class Arnavi4ProtocolDecoder extends BaseProtocolDecoder { if (recordType == RECORD_DATA) { positions.add(decodePosition(deviceSession, buf, length, time)); + } else { + buf.readBytes(length); // Skip other records } buf.readUnsignedByte(); // crc -- cgit v1.2.3