aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/org/traccar/protocol/ItsProtocolDecoder.java6
-rw-r--r--test/org/traccar/protocol/ItsProtocolDecoderTest.java3
2 files changed, 6 insertions, 3 deletions
diff --git a/src/org/traccar/protocol/ItsProtocolDecoder.java b/src/org/traccar/protocol/ItsProtocolDecoder.java
index f6112d122..226c27cd8 100644
--- a/src/org/traccar/protocol/ItsProtocolDecoder.java
+++ b/src/org/traccar/protocol/ItsProtocolDecoder.java
@@ -38,7 +38,7 @@ public class ItsProtocolDecoder extends BaseProtocolDecoder {
.expression("[^,]+,") // event
.groupBegin()
.expression("[^,]+,") // vendor
- .number("d+.d+.d+,") // firmware version
+ .expression("[^,]+,") // firmware version
.groupEnd("?")
.expression("[^,]+,") // type
.groupBegin()
@@ -52,8 +52,8 @@ public class ItsProtocolDecoder extends BaseProtocolDecoder {
.expression("[^,]+,") // vehicle registration
.number("([01]),") // valid
.groupEnd()
- .number("(dd),(dd),(dddd),") // date (ddmmyyyy)
- .number("(dd),(dd),(dd),") // time (hhmmss)
+ .number("(dd),?(dd),?(dddd),") // date (ddmmyyyy)
+ .number("(dd),?(dd),?(dd),") // time (hhmmss)
.expression("([AV]),").optional() // valid
.number("(d+.d+),([NS]),") // latitude
.number("(d+.d+),([EW]),") // longitude
diff --git a/test/org/traccar/protocol/ItsProtocolDecoderTest.java b/test/org/traccar/protocol/ItsProtocolDecoderTest.java
index 3ab305b54..7aeb66b7b 100644
--- a/test/org/traccar/protocol/ItsProtocolDecoderTest.java
+++ b/test/org/traccar/protocol/ItsProtocolDecoderTest.java
@@ -11,6 +11,9 @@ public class ItsProtocolDecoderTest extends ProtocolTest {
ItsProtocolDecoder decoder = new ItsProtocolDecoder(null);
verifyPosition(decoder, text(
+ "$,A,MFR,7.0,NR,01,L,869026034780985,PJ09BU1234,1,12112018,121953,12.756974,N,077.800025,E,000.0,318.03,15,794.0,001.3,000.7,TAMIL NAD,0,1,13.08,04.13,0,O,22,404,80,0919,71C1,0919,7168,19,0919,71c3,17,0919,71c2,11,0919,7167,09,0011,00,000173,D8,000000.00,,,"));
+
+ verifyPosition(decoder, text(
"$,04,XYZ123,0.0.1,TA,16,L,861359034100626,MH12AB1234,1,14,10,2018,04,50,52,018.489624,N,073.855980,E,000.0,039.86,13,584.1,01.11,00.75,AIRTEL,1,1,00.0,4.1,1,C,15,404,90,0c23,781a,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,1000,01,000005,13b75499,"));
verifyNull(decoder, text(