From d36fa0963f8e1045d2f974cd88a0be68aea6f2ef Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Fri, 8 Sep 2017 07:32:17 +1200 Subject: Handle H02 command results --- src/org/traccar/protocol/H02ProtocolDecoder.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/org') diff --git a/src/org/traccar/protocol/H02ProtocolDecoder.java b/src/org/traccar/protocol/H02ProtocolDecoder.java index 69e53ec27..c31f9edbb 100644 --- a/src/org/traccar/protocol/H02ProtocolDecoder.java +++ b/src/org/traccar/protocol/H02ProtocolDecoder.java @@ -158,7 +158,7 @@ public class H02ProtocolDecoder extends BaseProtocolDecoder { .text("V1,") .or() .text("V4,") - .any() + .expression("(.*),") // response .or() .text("V19,") .groupEnd() @@ -270,6 +270,10 @@ public class H02ProtocolDecoder extends BaseProtocolDecoder { position.setProtocol(getProtocolName()); position.setDeviceId(deviceSession.getDeviceId()); + if (parser.hasNext()) { + position.set(Position.KEY_RESULT, parser.next()); + } + DateBuilder dateBuilder = new DateBuilder(); if (parser.hasNext(3)) { dateBuilder.setTime(parser.nextInt(0), parser.nextInt(0), parser.nextInt(0)); -- cgit v1.2.3