From ba4cb97520ef9bbdd9be90b0c4307073469739c7 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Wed, 21 Aug 2013 21:00:41 +1200 Subject: Fix Totem regular expr --- src/org/traccar/protocol/TotemProtocolDecoder.java | 12 ++++++------ test/org/traccar/protocol/TotemProtocolDecoderTest.java | 3 +++ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/org/traccar/protocol/TotemProtocolDecoder.java b/src/org/traccar/protocol/TotemProtocolDecoder.java index b4fa177be..73bb18aac 100644 --- a/src/org/traccar/protocol/TotemProtocolDecoder.java +++ b/src/org/traccar/protocol/TotemProtocolDecoder.java @@ -45,13 +45,13 @@ public class TotemProtocolDecoder extends BaseProtocolDecoder { "([NS])," + "(\\d+)(\\d{2}\\.\\d+)," + // Longitude (DDDMM.MMMM) "([EW])," + - "(\\d+\\.\\d+)?," + // Speed - "(\\d+\\.\\d+)?," + // Course + "(\\d+\\.?\\d*)?," + // Speed + "(\\d+\\.?\\d*)?," + // Course "(\\d{2})(\\d{2})(\\d{2})" + // Date (DDMMYY) "[^\\*]+\\*\\p{XDigit}{2}\\|" + // Checksum - "\\d+.\\d\\|" + // PDOP - "(\\d+.\\d)\\|" + // HDOP - "\\d+.\\d\\|" + // VDOP + "\\d+\\.\\d+\\|" + // PDOP + "(\\d+\\.\\d+)\\|" + // HDOP + "\\d+\\.\\d+\\|" + // VDOP "(\\d+)\\|" + // IO Status "\\d+\\|" + // Time "\\d" + // Charged @@ -78,7 +78,7 @@ public class TotemProtocolDecoder extends BaseProtocolDecoder { "([EW])\\|" + "(\\d+\\.\\d+)?\\|" + // Speed "(\\d+)?\\|" + // Course - "(\\d+.\\d+)\\|" + // HDOP + "(\\d+\\.\\d+)\\|" + // HDOP "(\\d+)\\|" + // IO Status "\\d" + // Charged "(\\d{2})" + // Battery diff --git a/test/org/traccar/protocol/TotemProtocolDecoderTest.java b/test/org/traccar/protocol/TotemProtocolDecoderTest.java index 8572f1998..f241088d2 100644 --- a/test/org/traccar/protocol/TotemProtocolDecoderTest.java +++ b/test/org/traccar/protocol/TotemProtocolDecoderTest.java @@ -15,6 +15,9 @@ public class TotemProtocolDecoderTest { assertNull(decoder.decode(null, null, "$$BB862170017856731|AA$GPRMC,000000.00,V,0000.0000,N,00000.0000,E,000.0,000.0,000000,,,A*73|00.0|00.0|00.0|000000001000|20000000000000|13790000|00000000|00000000|00000000|0.0000|0007|8C23")); + assertNotNull(decoder.decode(null, null, + "$$B8862170017856731|AA$GPRMC,171849.00,A,3644.9893,N,01012.9927,E,0.049,51,200813,,,A*73|1.59|0.97|1.25|100000001000|20130820171849|13690000|00000000|019BD508|00000000|0.0000|0026|1B2C")); + assertNotNull(decoder.decode(null, null, "$$B2359772032984289|AA$GPRMC,104446.000,A,5011.3944,N,01439.6637,E,0.00,,290212,,,A*7D|01.8|00.9|01.5|000000100000|20120229104446|14151221|00050000|046D085E|0000|0.0000|1170|29A7")); -- cgit v1.2.3