diff options
-rw-r--r-- | src/org/traccar/protocol/HaicomProtocolDecoder.java | 4 | ||||
-rw-r--r-- | test/org/traccar/protocol/HaicomProtocolDecoderTest.java | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/org/traccar/protocol/HaicomProtocolDecoder.java b/src/org/traccar/protocol/HaicomProtocolDecoder.java index fc144e934..5955ac905 100644 --- a/src/org/traccar/protocol/HaicomProtocolDecoder.java +++ b/src/org/traccar/protocol/HaicomProtocolDecoder.java @@ -98,13 +98,13 @@ public class HaicomProtocolDecoder extends BaseProtocolDecoder { // Latitude Double latitude = Double.valueOf(parser.group(index++)); latitude += Double.valueOf(parser.group(index++)) / 60000; - if ((flags & 0x2) == 0) latitude = -latitude; + if ((flags & 0x4) == 0) latitude = -latitude; position.setLatitude(latitude); // Longitude Double longitude = Double.valueOf(parser.group(index++)); longitude += Double.valueOf(parser.group(index++)) / 60000; - if ((flags & 0x4) == 0) longitude = -longitude; + if ((flags & 0x2) == 0) longitude = -longitude; position.setLongitude(longitude); // Speed diff --git a/test/org/traccar/protocol/HaicomProtocolDecoderTest.java b/test/org/traccar/protocol/HaicomProtocolDecoderTest.java index 13659d040..4ccd0fbd4 100644 --- a/test/org/traccar/protocol/HaicomProtocolDecoderTest.java +++ b/test/org/traccar/protocol/HaicomProtocolDecoderTest.java @@ -12,6 +12,9 @@ public class HaicomProtocolDecoderTest extends ProtocolDecoderTest { HaicomProtocolDecoder decoder = new HaicomProtocolDecoder(null); verify(decoder.decode(null, null, + "$GPRS012497007097169,T100001,150618,230031,5402267400332464,0004,2014,000001,,,1,00#V040*")); + + verify(decoder.decode(null, null, "$GPRS123456789012345,602S19A,100915,063515,7240649312041079,0019,3156,111000,10004,0000,11111,00LH#V037")); verify(decoder.decode(null, null, |