From 4e624c4a3446cff59d3247565d4455f531636389 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Wed, 19 May 2021 22:05:12 -0700 Subject: Implement server response --- src/main/java/org/traccar/protocol/PluginProtocolDecoder.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/main/java') 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; -- cgit v1.2.3