From 8a918e12f4a899a4ffdb67c58d57daefb94c5ab4 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Mon, 2 Dec 2019 09:02:06 -0800 Subject: Support empty vendor --- src/main/java/org/traccar/protocol/ItsProtocolDecoder.java | 2 +- src/test/java/org/traccar/protocol/ItsProtocolDecoderTest.java | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/traccar/protocol/ItsProtocolDecoder.java b/src/main/java/org/traccar/protocol/ItsProtocolDecoder.java index d76d9c92e..4746f7dd5 100644 --- a/src/main/java/org/traccar/protocol/ItsProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/ItsProtocolDecoder.java @@ -41,7 +41,7 @@ public class ItsProtocolDecoder extends BaseProtocolDecoder { .text("$") .expression(",?[^,]+,") // event .groupBegin() - .expression("[^,]+,") // vendor + .expression("[^,]*,") // vendor .expression("[^,]+,") // firmware version .expression("(..),") // status .number("(d+),").optional() // event diff --git a/src/test/java/org/traccar/protocol/ItsProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/ItsProtocolDecoderTest.java index c6c13c810..dedb30242 100644 --- a/src/test/java/org/traccar/protocol/ItsProtocolDecoderTest.java +++ b/src/test/java/org/traccar/protocol/ItsProtocolDecoderTest.java @@ -14,6 +14,9 @@ public class ItsProtocolDecoderTest extends ProtocolTest { verifyNull(decoder, text( "$LGN,,869867037009679,3.2AIH,9.99546000,N,76.35886167,E")); + verifyPosition(decoder, text( + "$NRM,,3.2AIH,NR,01,L,869867037003854,,1,02122019,074801,9.99553167,N,76.35911000,E,0.0,125.73,18,103.7,0.10,0.10,CellOne Kerala,0,1,13.1,4.2,0,C,19,404,72,08FE,0940,13,08FE,093E,11,08FE,7DA7,07,08FE,093F,07,08FE,7DA6,0100,00,0,0,003372,6897.214,,,,,5_5_3_5_0,B74BBD72*")); + verifyPosition(decoder, text( "$,ID01,SAT,1.0.0,NR,1,L,868345034056903,DL3CAB1021,1,27052019,040234,28.359895,N,76.927879,E,0.0,285.6,12,254.9,1.4,0.7,IDEA,1,1,12.6,3.8,0,25,404,04,0138,0927,4ECD,0138,41,1C2B,0138,37,D77A,0138,34,D843,0138,33,0000,00,0.03,0.00,000091,A3,*")); -- cgit v1.2.3