aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/traccar/protocol/TramigoProtocolDecoder.java8
-rw-r--r--src/test/java/org/traccar/protocol/TramigoProtocolDecoderTest.java4
2 files changed, 6 insertions, 6 deletions
diff --git a/src/main/java/org/traccar/protocol/TramigoProtocolDecoder.java b/src/main/java/org/traccar/protocol/TramigoProtocolDecoder.java
index 1296929bc..ddd669b36 100644
--- a/src/main/java/org/traccar/protocol/TramigoProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/TramigoProtocolDecoder.java
@@ -153,8 +153,8 @@ public class TramigoProtocolDecoder extends BaseProtocolDecoder {
position.set(Position.KEY_STATUS, status);
position.setValid(true);
- position.setLatitude(buf.readInt() * 0.00001);
- position.setLongitude(buf.readInt() * 0.00001);
+ position.setLatitude(buf.readIntLE() * 0.00001);
+ position.setLongitude(buf.readIntLE() * 0.00001);
position.setSpeed(UnitsConverter.knotsFromKph(buf.readUnsignedShortLE()));
position.setCourse(buf.readUnsignedShortLE());
@@ -172,7 +172,7 @@ public class TramigoProtocolDecoder extends BaseProtocolDecoder {
buf.readUnsignedByte(); // reserved
break;
case 1:
- buf.skipBytes(buf.readUnsignedShortLE()); // landmark
+ buf.skipBytes(buf.readUnsignedShortLE() - 3); // landmark
break;
case 4:
buf.skipBytes(53); // trip
@@ -191,7 +191,7 @@ public class TramigoProtocolDecoder extends BaseProtocolDecoder {
buf.skipBytes(40); // analog
break;
case 50:
- buf.skipBytes(buf.readUnsignedShortLE()); // console
+ buf.skipBytes(buf.readUnsignedShortLE() - 3); // console
break;
case 255:
buf.skipBytes(4); // acknowledgement
diff --git a/src/test/java/org/traccar/protocol/TramigoProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/TramigoProtocolDecoderTest.java
index fdef8ce19..d692a41d5 100644
--- a/src/test/java/org/traccar/protocol/TramigoProtocolDecoderTest.java
+++ b/src/test/java/org/traccar/protocol/TramigoProtocolDecoderTest.java
@@ -10,8 +10,8 @@ public class TramigoProtocolDecoderTest extends ProtocolTest {
var decoder = inject(new TramigoProtocolDecoder(null));
- /*verifyNull(decoder, binary(
- "0480001df35b1b69101a023ef34f0090436d38003200380e0000850081c0e4ff6d542f00000015000000050000000000007600a20100008f436d3800014400000000000000000021000a0006005a574a6169726f7320486972692043656e747265205072696d617279205363686f6f6c536f7574686572746f6e486172617265"));*/
+ verifyPosition(decoder, binary(
+ "0480001df35b1b69101a023ef34f0090436d38003200380e0000850081c0e4ff6d542f00000015000000050000000000007600a20100008f436d3800014400000000000000000021000a0006005a574a6169726f7320486972692043656e747265205072696d617279205363686f6f6c536f7574686572746f6e486172617265"));
verifyAttributes(decoder, binary(
"8000c426b000a6000101c557037598050d5c8a595472616d69676f3a204d6f76696e672c20302e3132206b6d2045206f66204c617275742054696e2049736c616d6963205072696d617279205363686f6f6c2c2054616970696e672c20506572616b2c204d592c20342e38333134392c203130302e37333038352c204e572077697468207370656564203130206b6d2f682c2030303a34393a30382041756720392020454f46"));