From b95d93b27e6b1b22db89aac994131bac26362123 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Tue, 4 Apr 2017 02:27:57 +1200 Subject: Decode H02 additional data --- src/org/traccar/protocol/H02ProtocolDecoder.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/org/traccar') diff --git a/src/org/traccar/protocol/H02ProtocolDecoder.java b/src/org/traccar/protocol/H02ProtocolDecoder.java index b11a1e0e6..b78f21d8d 100644 --- a/src/org/traccar/protocol/H02ProtocolDecoder.java +++ b/src/org/traccar/protocol/H02ProtocolDecoder.java @@ -179,9 +179,12 @@ public class H02ProtocolDecoder extends BaseProtocolDecoder { .number("(x+),") // lac .number("(x+)#") // cid .or() - .expression(",.*") + .number(",(d+),") + .number("(d+),") + .number("(d+),") + .number("(d+)#") .or() - .text("#") + .any() .groupEnd() .compile(); @@ -262,6 +265,12 @@ public class H02ProtocolDecoder extends BaseProtocolDecoder { position.setNetwork(new Network(CellTower.fromLacCid(parser.nextInt(16), parser.nextInt(16)))); } + if (parser.hasNext(4)) { + for (int i = 1; i <= 4; i++) { + position.set(Position.PREFIX_IO + i, parser.nextInt()); + } + } + return position; } -- cgit v1.2.3