aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2019-06-29 21:19:50 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2019-06-29 21:19:50 -0700
commit5b7722bd3fd6f7782eadd4b1afc518fdba28e8d3 (patch)
tree00d1689f3e6d40100201f33b4e933c121ace2997 /src/main
parentb56dea19d0fb6742425c00af0ad6034bd4b1abd6 (diff)
downloadtraccar-server-5b7722bd3fd6f7782eadd4b1afc518fdba28e8d3.tar.gz
traccar-server-5b7722bd3fd6f7782eadd4b1afc518fdba28e8d3.tar.bz2
traccar-server-5b7722bd3fd6f7782eadd4b1afc518fdba28e8d3.zip
Implement protocol responses
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/traccar/protocol/H02ProtocolDecoder.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/main/java/org/traccar/protocol/H02ProtocolDecoder.java b/src/main/java/org/traccar/protocol/H02ProtocolDecoder.java
index 22bbe4441..137689a67 100644
--- a/src/main/java/org/traccar/protocol/H02ProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/H02ProtocolDecoder.java
@@ -554,9 +554,18 @@ public class H02ProtocolDecoder extends BaseProtocolDecoder {
String sentence = buf.toString(StandardCharsets.US_ASCII).trim();
int typeStart = sentence.indexOf(',', sentence.indexOf(',') + 1) + 1;
int typeEnd = sentence.indexOf(',', typeStart);
+ if (typeEnd < 0) {
+ typeEnd = sentence.indexOf('#', typeStart);
+ }
if (typeEnd > 0) {
String type = sentence.substring(typeStart, typeEnd);
switch (type) {
+ case "V0":
+ case "HTBT":
+ if (channel != null) {
+ channel.writeAndFlush(new NetworkMessage(sentence, remoteAddress));
+ }
+ return null;
case "NBR":
return decodeLbs(sentence, channel, remoteAddress);
case "LINK":