diff options
-rw-r--r-- | src/org/traccar/protocol/SanavProtocolDecoder.java | 4 | ||||
-rw-r--r-- | test/org/traccar/protocol/SanavProtocolDecoderTest.java | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/org/traccar/protocol/SanavProtocolDecoder.java b/src/org/traccar/protocol/SanavProtocolDecoder.java index c736b2ba3..151c55795 100644 --- a/src/org/traccar/protocol/SanavProtocolDecoder.java +++ b/src/org/traccar/protocol/SanavProtocolDecoder.java @@ -38,7 +38,7 @@ public class SanavProtocolDecoder extends BaseProtocolDecoder { .number("(d+)") // imei .expression("&?rmc[:=]") .text("$GPRMC,") - .number("(dd)(dd)(dd).(ddd),") // time (hhmmss.sss) + .number("(dd)(dd)(dd).d+,") // time (hhmmss.sss) .expression("([AV]),") // validity .number("(d+)(dd.d+),") // latitude .expression("([NS]),") @@ -69,7 +69,7 @@ public class SanavProtocolDecoder extends BaseProtocolDecoder { position.setDeviceId(deviceSession.getDeviceId()); DateBuilder dateBuilder = new DateBuilder() - .setTime(parser.nextInt(0), parser.nextInt(0), parser.nextInt(0), parser.nextInt(0)); + .setTime(parser.nextInt(0), parser.nextInt(0), parser.nextInt(0)); position.setValid(parser.next().equals("A")); position.setLatitude(parser.nextCoordinate()); diff --git a/test/org/traccar/protocol/SanavProtocolDecoderTest.java b/test/org/traccar/protocol/SanavProtocolDecoderTest.java index be7b3bbf4..903f0aec0 100644 --- a/test/org/traccar/protocol/SanavProtocolDecoderTest.java +++ b/test/org/traccar/protocol/SanavProtocolDecoderTest.java @@ -9,6 +9,9 @@ public class SanavProtocolDecoderTest extends ProtocolTest { public void testDecode() throws Exception { SanavProtocolDecoder decoder = new SanavProtocolDecoder(new SanavProtocol()); + + verifyPosition(decoder, text( + "imei=1234567890&rmc=$GPRMC,091950.00,V,5300.10000,N,00900.14000,E,0.160,,200513,,,A*68,STOP,V3.872;67%,S4,H8.3,D2.38")); verifyPosition(decoder, text( "imei=352024028982787&rmc=$GPRMC,103048.000,A,4735.0399,N,01905.2895,E,0.00,0.00,171013,,*05,AUTO-4095mv"), |