From e6e6afd89be2f64488e61cd4c1391c898e8f6cc3 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Fri, 18 Sep 2015 19:06:31 +1200 Subject: Handle two digit longitude value --- src/org/traccar/protocol/T55ProtocolDecoder.java | 5 +---- test/org/traccar/protocol/T55ProtocolDecoderTest.java | 6 ++++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/org/traccar/protocol/T55ProtocolDecoder.java b/src/org/traccar/protocol/T55ProtocolDecoder.java index 1376ca123..2771d1d8e 100644 --- a/src/org/traccar/protocol/T55ProtocolDecoder.java +++ b/src/org/traccar/protocol/T55ProtocolDecoder.java @@ -20,10 +20,7 @@ import java.util.Calendar; import java.util.TimeZone; import java.util.regex.Matcher; import java.util.regex.Pattern; - import org.jboss.netty.channel.Channel; -import org.jboss.netty.channel.ChannelHandlerContext; - import org.traccar.BaseProtocolDecoder; import org.traccar.model.Event; import org.traccar.model.Position; @@ -40,7 +37,7 @@ public class T55ProtocolDecoder extends BaseProtocolDecoder { "([AV])," + // Validity "(\\d{2})(\\d{2}\\.\\d+)," + // Latitude (DDMM.MMMM) "([NS])," + - "(\\d{3})(\\d{2}\\.\\d+)," + // Longitude (DDDMM.MMMM) + "(\\d{2,3})(\\d{2}\\.\\d+)," + // Longitude (DDDMM.MMMM) "([EW])," + "(\\d+\\.?\\d*)?," + // Speed "(\\d+\\.?\\d*)?," + // Course diff --git a/test/org/traccar/protocol/T55ProtocolDecoderTest.java b/test/org/traccar/protocol/T55ProtocolDecoderTest.java index 2aa82f400..04c35aab7 100644 --- a/test/org/traccar/protocol/T55ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/T55ProtocolDecoderTest.java @@ -1,9 +1,8 @@ package org.traccar.protocol; -import org.traccar.helper.TestIdentityManager; -import static org.traccar.helper.DecoderVerifier.verify; import static org.junit.Assert.assertNull; import org.junit.Test; +import static org.traccar.helper.DecoderVerifier.verify; public class T55ProtocolDecoderTest extends ProtocolDecoderTest { @@ -19,6 +18,9 @@ public class T55ProtocolDecoderTest extends ProtocolDecoderTest { assertNull(decoder.decode(null, null, "$PCPTI,CradlePoint Test,184453,184453.0,6F*57")); assertNull(decoder.decode(null, null, "IMEI 351467108700000")); + + verify(decoder.decode(null, null, + "$GPRMC,012006,A,4828.10,N,1353.52,E,0.00,0.00,180915,020.3,E*42")); verify(decoder.decode(null, null, "$GPRMC,094907.000,A,6000.5332,N,03020.5192,E,1.17,60.26,091111,,*33")); -- cgit v1.2.3