aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2021-05-19 22:05:12 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2021-05-19 22:05:12 -0700
commit4e624c4a3446cff59d3247565d4455f531636389 (patch)
treee03afe3ea4034af08a50e29756cd53ed4c9ff4d5 /src
parent8622bb41a28d8efaf787fbe0f4170127461b5f6c (diff)
downloadtraccar-server-4e624c4a3446cff59d3247565d4455f531636389.tar.gz
traccar-server-4e624c4a3446cff59d3247565d4455f531636389.tar.bz2
traccar-server-4e624c4a3446cff59d3247565d4455f531636389.zip
Implement server response
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/traccar/protocol/PluginProtocolDecoder.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/protocol/PluginProtocolDecoder.java b/src/main/java/org/traccar/protocol/PluginProtocolDecoder.java
index 949c994ee..0d4ea7139 100644
--- a/src/main/java/org/traccar/protocol/PluginProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/PluginProtocolDecoder.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019 Anton Tananaev (anton@traccar.org)
+ * Copyright 2019 - 2021 Anton Tananaev (anton@traccar.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,6 +18,7 @@ package org.traccar.protocol;
import io.netty.channel.Channel;
import org.traccar.BaseProtocolDecoder;
import org.traccar.DeviceSession;
+import org.traccar.NetworkMessage;
import org.traccar.Protocol;
import org.traccar.helper.BitUtil;
import org.traccar.helper.Parser;
@@ -75,6 +76,10 @@ public class PluginProtocolDecoder extends BaseProtocolDecoder {
protected Object decode(
Channel channel, SocketAddress remoteAddress, Object msg) throws Exception {
+ if (channel != null) {
+ channel.writeAndFlush(new NetworkMessage("$$hb,1#", remoteAddress));
+ }
+
Parser parser = new Parser(PATTERN, (String) msg);
if (!parser.matches()) {
return null;