From dd943e107a9680948747fb0ab2132cc57d027352 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 28 Nov 2015 08:53:30 +1300 Subject: Fix GPS103 LBS regex pattern (fix #1558) --- src/org/traccar/protocol/Gps103ProtocolDecoder.java | 2 +- test/org/traccar/protocol/Gps103ProtocolDecoderTest.java | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/org/traccar/protocol/Gps103ProtocolDecoder.java b/src/org/traccar/protocol/Gps103ProtocolDecoder.java index a91848f5b..2b8eb2c67 100644 --- a/src/org/traccar/protocol/Gps103ProtocolDecoder.java +++ b/src/org/traccar/protocol/Gps103ProtocolDecoder.java @@ -67,7 +67,7 @@ public class Gps103ProtocolDecoder extends BaseProtocolDecoder { .text("imei:") .number("(d+),") // imei .expression("[^,]+,") // alarm - .number("d+,,") + .number("d*,,") .text("L,,,") .number("(x+),,") // lac .number("(x+),,,") // cid diff --git a/test/org/traccar/protocol/Gps103ProtocolDecoderTest.java b/test/org/traccar/protocol/Gps103ProtocolDecoderTest.java index 371b137fd..8ee080560 100644 --- a/test/org/traccar/protocol/Gps103ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Gps103ProtocolDecoderTest.java @@ -10,6 +10,9 @@ public class Gps103ProtocolDecoderTest extends ProtocolDecoderTest { Gps103ProtocolDecoder decoder = new Gps103ProtocolDecoder(new Gps103Protocol()); + verifyAttributes(decoder, text( + "imei:359710049075097,help me,,,L,,,113b,,558f,,,,,0,0,,,")); + verifyAttributes(decoder, text( "imei:359710041100000,tracker,000000000,,L,,,fa8,,c9af,,,,,0,0,0.00%,,")); -- cgit v1.2.3