From a6b992410f828da7d36284a5f005617f50723b1b Mon Sep 17 00:00:00 2001 From: Geodelta <67260714+geodelta@users.noreply.github.com> Date: Tue, 30 Jun 2020 16:57:27 +0200 Subject: Implement Mictrack Low Altitude Flight Decoder (#4546) * Implement Mictrack Low Altitude Flight Decoder * Fix headers * Add MictrackLowAltitudeFlightProtocolDecoderTest test for position * Merge Mictrack and Mictrack Low Altitude Flight decoders * Remove empty line * Minor style changes based on code review * Cast msg Object to String once in MictrackProtocolDecoder Co-authored-by: Roeland Boeters --- .../traccar/protocol/MictrackProtocolDecoderTest.java | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'src/test/java/org/traccar/protocol') diff --git a/src/test/java/org/traccar/protocol/MictrackProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/MictrackProtocolDecoderTest.java index 794b2b57e..605a02b92 100644 --- a/src/test/java/org/traccar/protocol/MictrackProtocolDecoderTest.java +++ b/src/test/java/org/traccar/protocol/MictrackProtocolDecoderTest.java @@ -6,7 +6,7 @@ import org.traccar.ProtocolTest; public class MictrackProtocolDecoderTest extends ProtocolTest { @Test - public void testDecode() throws Exception { + public void testDecodeStandard() throws Exception { MictrackProtocolDecoder decoder = new MictrackProtocolDecoder(null); @@ -31,7 +31,22 @@ public class MictrackProtocolDecoderTest extends ProtocolTest { verifyAttributes(decoder, text( "MT;5;866425031379169;RH;5+190116112648+0+0+0+0+11+3954+1")); + } + + @Test + public void testDecodeLowAltitude() throws Exception { + + MictrackProtocolDecoder decoder = new MictrackProtocolDecoder(null); + + verifyPositions(decoder, text( + "861108032038761$062232.00,A,2238.2832,N,11401.7381,E,0.01,309.62,95.0,131117")); + + verifyPositions(decoder, text( + "861108032038761$062232.00,A,2238.2832,N,11401.7381,E,0.01,309.62,95.0,131117$062332.00,A,2238.2836,N,11401.7386,E,0.06,209.62,95.0,131117")); + verifyPositions(decoder, text( + "861108032038761$062232.00,A,2238.2832,N,11401.7381,E,0.01,309.62,95.0,131117"), + position("2017-11-13 06:22:32.000", true, 22.63806, 114.028976)); } } -- cgit v1.2.3