aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorAuroraRAS <chplee@gmail.com>2021-05-06 01:41:50 +0800
committerAuroraRAS <chplee@gmail.com>2021-05-06 01:41:50 +0800
commit2f398690b1c4ddb837ff59a92ed6caea54d35772 (patch)
tree9f8ba3a21e6ca711d6f3fbf600ad4c644b048bdc /src/test
parent0d8f2af5ea9bafeec92a54d10b190165fa0b5d91 (diff)
downloadtraccar-server-2f398690b1c4ddb837ff59a92ed6caea54d35772.tar.gz
traccar-server-2f398690b1c4ddb837ff59a92ed6caea54d35772.tar.bz2
traccar-server-2f398690b1c4ddb837ff59a92ed6caea54d35772.zip
Make the code more compatible with Traccar's standards
Diffstat (limited to 'src/test')
-rw-r--r--src/test/java/org/traccar/protocol/Mavlink2ProtocolDecoderTest.java46
1 files changed, 2 insertions, 44 deletions
diff --git a/src/test/java/org/traccar/protocol/Mavlink2ProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/Mavlink2ProtocolDecoderTest.java
index 2f824b603..f4b6d8229 100644
--- a/src/test/java/org/traccar/protocol/Mavlink2ProtocolDecoderTest.java
+++ b/src/test/java/org/traccar/protocol/Mavlink2ProtocolDecoderTest.java
@@ -7,50 +7,8 @@ public class Mavlink2ProtocolDecoderTest extends ProtocolTest {
@Test
public void testDecode() throws Exception {
-
var decoder = new Mavlink2ProtocolDecoder(null);
-
- byte[] pkt = {
- // Packet start marker
- (byte) 0xfd,
- // Payload length
- (byte) 0x1c,
- // Incompatibility Flags
- (byte) 0x00,
- // Compatibility Flags
- (byte) 0x00,
- // Packet sequence
- (byte) 0x74,
- // System ID (sender)
- (byte) 0x01,
- // Component ID (sender)
- (byte) 0x01,
- // Message ID (low, middle, high bytes)
- (byte) 0x21, (byte) 0x00, (byte) 0x00,
- // Payload Message data
- // Timestamp (time since system boot).
- (byte) 0xcc, (byte) 0xae, (byte) 0x08, (byte) 0x00,
- // degE7 Latitude
- (byte) 0x40, (byte) 0x05, (byte) 0xd3, (byte) 0x23,
- // degE7 Longitude
- (byte) 0xb8, (byte) 0x9a, (byte) 0xa3, (byte) 0x0e,
- // mm Altitude (MSL)
- (byte) 0x2e, (byte) 0xd0, (byte) 0x06, (byte) 0x00,
- // mm Altitude above ground
- (byte) 0x67, (byte) 0x00, (byte) 0x00, (byte) 0x00,
- // cm/s Ground X Speed
- (byte) 0x8b, (byte) 0xff,
- // cm/s Ground Y Speed
- (byte) 0x05, (byte) 0x00,
- // cm/s Ground Z Speed
- (byte) 0x03, (byte) 0x00,
- // cdeg Vehicle heading (yaw angle)
- (byte) 0x4f, (byte) 0x2d,
- // Checksum (low byte, high byte)
- (byte) 0x00, (byte) 0x00
- };
- verifyPosition(decoder, pkt);
-
+ verifyAttributes(decoder, binary("fd1c0000ce01012100004da91f004005d323b89aa30ea6ed070099fb0100f7fffdff0000942c4a88"));
+ verifyAttributes(decoder, binary("fd1c0000e7010121000047aa1f004005d323b89aa30e9ced070093fb0100f8fffdff0000952c70ff"));
}
-
}