From 4f235bcac5b13733684fed8e0ef05968123f6e10 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Fri, 28 Apr 2017 16:45:30 +1200 Subject: Fix Antlanta L-100 regex pattern --- src/org/traccar/protocol/L100ProtocolDecoder.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/org/traccar/protocol/L100ProtocolDecoder.java b/src/org/traccar/protocol/L100ProtocolDecoder.java index f98e532bc..618448080 100644 --- a/src/org/traccar/protocol/L100ProtocolDecoder.java +++ b/src/org/traccar/protocol/L100ProtocolDecoder.java @@ -40,8 +40,9 @@ public class L100ProtocolDecoder extends BaseProtocolDecoder { .text("ATL") .number("(d{15}),") // imei .text("$GPRMC,") - .number("(dd)(dd)(dd).(ddd),") // time (hhmmss.sss) - .expression("([AV]),") // validity + .number("(dd)(dd)(dd)") // time (hhmmss.sss) + .number(".(ddd)").optional() + .expression(",([AV]),") // validity .number("(dd)(dd.d+),") // latitude .expression("([NS]),") .number("(ddd)(dd.d+),") // longitude @@ -52,7 +53,7 @@ public class L100ProtocolDecoder extends BaseProtocolDecoder { .any() .text("#") .number("([01]+),") // io status - .number("(d+.d+|N.C),") // adc + .number("(d+.?d*|N.C),") // adc .expression("[^,]*,") // reserved .expression("[^,]*,") // reserved .number("(d+.d+),") // odometer @@ -61,8 +62,8 @@ public class L100ProtocolDecoder extends BaseProtocolDecoder { .number("(d+),") // gsm .number("(d+),") // mcc .number("(d+),") // mnc - .number("(d+),") // lac - .number("(d+)") // cid + .number("(x+),") // lac + .number("(x+)") // cid .text("ATL") .compile(); @@ -111,7 +112,7 @@ public class L100ProtocolDecoder extends BaseProtocolDecoder { int rssi = parser.nextInt(0); position.setNetwork(new Network(CellTower.from( - parser.nextInt(0), parser.nextInt(0), parser.nextInt(0), parser.nextInt(0), rssi))); + parser.nextInt(0), parser.nextInt(0), parser.nextHexInt(0), parser.nextHexInt(0), rssi))); return position; } -- cgit v1.2.3