aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xdemo.sh25
-rw-r--r--src/org/traccar/protocol/T55ProtocolDecoder.java6
2 files changed, 28 insertions, 3 deletions
diff --git a/demo.sh b/demo.sh
new file mode 100755
index 000000000..50e48e496
--- /dev/null
+++ b/demo.sh
@@ -0,0 +1,25 @@
+(echo -n -e "\
+\$PGID,123456789012345*06\r\n\
+\$GPRMC,184332.07,A,1929.459,S,02410.381,E,74.00,16.78,210410,0.0,E,A*2B\r\n\
+\$GPRMC,184336.07,A,1929.380,S,02410.405,E,74.00,16.78,210410,0.0,E,A*27\r\n\
+\$GPRMC,184340.07,A,1929.301,S,02410.429,E,74.00,16.78,210410,0.0,E,A*21\r\n\
+\$GPRMC,184344.07,A,1929.223,S,02410.452,E,74.00,16.78,210410,0.0,E,A*28\r\n\
+\$GPRMC,184348.07,A,1929.144,S,02410.476,E,74.00,16.78,210410,0.0,E,A*20\r\n\
+\$GPRMC,184352.07,A,1929.065,S,02410.500,E,74.00,16.78,210410,0.0,E,A*29\r\n\
+\$GPRMC,184356.07,A,1928.986,S,02410.524,E,74.00,16.78,210410,0.0,E,A*2E\r\n\
+\$GPRMC,184400.08,A,1928.907,S,02410.547,E,74.00,16.78,210410,0.0,E,A*29\r\n\
+\$GPRMC,184404.08,A,1928.829,S,02410.571,E,74.00,16.78,210410,0.0,E,A*25\r\n\
+\$GPRMC,184408.08,A,1928.750,S,02410.595,E,74.00,16.78,210410,0.0,E,A*22\r\n\
+\$GPRMC,184412.08,A,1928.671,S,02410.619,E,74.00,16.78,210410,0.0,E,A*2C\r\n\
+\$GPRMC,184416.08,A,1928.592,S,02410.642,E,74.00,16.78,210410,0.0,E,A*28\r\n\
+\$GPRMC,184420.08,A,1928.513,S,02410.666,E,74.00,16.78,210410,0.0,E,A*22\r\n\
+\$GPRMC,184424.08,A,1928.435,S,02410.690,E,74.00,16.78,210410,0.0,E,A*2A\r\n\
+\$GPRMC,184428.08,A,1928.356,S,02410.714,E,74.00,16.78,210410,0.0,E,A*29\r\n\
+\$GPRMC,184432.08,A,1928.277,S,02410.737,E,74.00,16.78,210410,0.0,E,A*21\r\n\
+\$GPRMC,184436.08,A,1928.198,S,02410.761,E,74.00,16.78,210410,0.0,E,A*24\r\n\
+\$GPRMC,184440.08,A,1928.119,S,02410.785,E,74.00,16.78,210410,0.0,E,A*26\r\n\
+\$GPRMC,184444.08,A,1928.041,S,02410.809,E,74.00,16.78,210410,0.0,E,A*25\r\n\
+\$GPRMC,184448.08,A,1927.962,S,02410.832,E,74.00,16.78,210410,0.0,E,A*26\r\n\
+";) | nc -v localhost 5005
+
+
diff --git a/src/org/traccar/protocol/T55ProtocolDecoder.java b/src/org/traccar/protocol/T55ProtocolDecoder.java
index d531f1adf..116343c5a 100644
--- a/src/org/traccar/protocol/T55ProtocolDecoder.java
+++ b/src/org/traccar/protocol/T55ProtocolDecoder.java
@@ -47,11 +47,11 @@ public class T55ProtocolDecoder extends GenericProtocolDecoder {
*/
static private Pattern pattern = Pattern.compile(
"\\$GPRMC," +
- "(\\d{2})(\\d{2})(\\d{2})\\.(\\d{3})," + // Time (HHMMSS.SSS)
+ "(\\d{2})(\\d{2})(\\d{2})\\.(\\d+)," + // Time (HHMMSS.SSS)
"([AV])," + // Validity
- "(\\d{2})(\\d{2}\\.\\d{4})," + // Latitude (DDMM.MMMM)
+ "(\\d{2})(\\d{2}\\.\\d+)," + // Latitude (DDMM.MMMM)
"([NS])," +
- "(\\d{3})(\\d{2}\\.\\d{4})," + // Longitude (DDDMM.MMMM)
+ "(\\d{3})(\\d{2}\\.\\d+)," + // Longitude (DDDMM.MMMM)
"([EW])," +
"(\\d+\\.\\d{2})?," + // Speed
"(\\d+\\.\\d{2})?," + // Course