diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2018-01-24 01:03:18 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2018-01-24 01:03:18 +1300 |
commit | 8b84c115ff396532159d4b890618a1a7bf2fe4cb (patch) | |
tree | 1676d5db850adc32dfd6ffff1f327fa8139b2a8a | |
parent | 00534cbfde4883dc6264aef1d7a913b89a712fb1 (diff) | |
download | traccar-server-8b84c115ff396532159d4b890618a1a7bf2fe4cb.tar.gz traccar-server-8b84c115ff396532159d4b890618a1a7bf2fe4cb.tar.bz2 traccar-server-8b84c115ff396532159d4b890618a1a7bf2fe4cb.zip |
Fix VT200 longitude issue
-rw-r--r-- | src/org/traccar/protocol/Vt200ProtocolDecoder.java | 2 | ||||
-rw-r--r-- | test/org/traccar/protocol/Vt200ProtocolDecoderTest.java | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/Vt200ProtocolDecoder.java b/src/org/traccar/protocol/Vt200ProtocolDecoder.java index 30fd88615..d08107b16 100644 --- a/src/org/traccar/protocol/Vt200ProtocolDecoder.java +++ b/src/org/traccar/protocol/Vt200ProtocolDecoder.java @@ -84,7 +84,7 @@ public class Vt200ProtocolDecoder extends BaseProtocolDecoder { if (!BitUtil.check(flags, 1)) { position.setLatitude(-position.getLatitude()); } - if (!BitUtil.check(flags, 1)) { + if (!BitUtil.check(flags, 2)) { position.setLongitude(-position.getLongitude()); } diff --git a/test/org/traccar/protocol/Vt200ProtocolDecoderTest.java b/test/org/traccar/protocol/Vt200ProtocolDecoderTest.java index 42ed4a652..9ce01c966 100644 --- a/test/org/traccar/protocol/Vt200ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Vt200ProtocolDecoderTest.java @@ -10,6 +10,9 @@ public class Vt200ProtocolDecoderTest extends ProtocolTest { Vt200ProtocolDecoder decoder = new Vt200ProtocolDecoder(new Vt200Protocol()); + verifyPosition(decoder, binary( + "28192030961807208200210101b919011818375801245774036424612500160917000003aa008800007b00aa3429")); + verifyNull(decoder, binary( "286310373094563082002701033d010817143327c68a14841e00c27f550e9a000000000c000000084700200120007d01af260b29")); |