aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/H02ProtocolDecoder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2017-09-08 07:32:17 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2017-09-08 07:32:17 +1200
commitd36fa0963f8e1045d2f974cd88a0be68aea6f2ef (patch)
treea84acd97ac49242a0fafd8b5af015e878ed8ca67 /src/org/traccar/protocol/H02ProtocolDecoder.java
parente84d1addacd76c05416c31b9e10b6a1618e41c9d (diff)
downloadtrackermap-server-d36fa0963f8e1045d2f974cd88a0be68aea6f2ef.tar.gz
trackermap-server-d36fa0963f8e1045d2f974cd88a0be68aea6f2ef.tar.bz2
trackermap-server-d36fa0963f8e1045d2f974cd88a0be68aea6f2ef.zip
Handle H02 command results
Diffstat (limited to 'src/org/traccar/protocol/H02ProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/H02ProtocolDecoder.java6
1 files changed, 5 insertions, 1 deletions
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));