aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2017-11-08 06:44:10 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2017-11-08 06:44:10 +1300
commit92f00d0da0dafd08ccf2a623406963e61fcde276 (patch)
tree33a88894aaebb26e80de5e497e28223be6d66a60
parent5bd69427184618591da88161aa51ed00baa85a89 (diff)
downloadtrackermap-server-92f00d0da0dafd08ccf2a623406963e61fcde276.tar.gz
trackermap-server-92f00d0da0dafd08ccf2a623406963e61fcde276.tar.bz2
trackermap-server-92f00d0da0dafd08ccf2a623406963e61fcde276.zip
Fix D-WAY heartbeat response
-rw-r--r--src/org/traccar/protocol/DwayProtocolDecoder.java4
-rw-r--r--test/org/traccar/protocol/DwayProtocolDecoderTest.java2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/org/traccar/protocol/DwayProtocolDecoder.java b/src/org/traccar/protocol/DwayProtocolDecoder.java
index 767b35c72..121681588 100644
--- a/src/org/traccar/protocol/DwayProtocolDecoder.java
+++ b/src/org/traccar/protocol/DwayProtocolDecoder.java
@@ -59,9 +59,9 @@ public class DwayProtocolDecoder extends BaseProtocolDecoder {
Channel channel, SocketAddress remoteAddress, Object msg) throws Exception {
String sentence = (String) msg;
- if (sentence.startsWith(">H")) {
+ if (sentence.equals("AA55,HB")) {
if (channel != null) {
- channel.write(">ALIVE\r\n");
+ channel.write("55AA,HB,OK\r\n");
}
return null;
}
diff --git a/test/org/traccar/protocol/DwayProtocolDecoderTest.java b/test/org/traccar/protocol/DwayProtocolDecoderTest.java
index be51f2b94..621aabf92 100644
--- a/test/org/traccar/protocol/DwayProtocolDecoderTest.java
+++ b/test/org/traccar/protocol/DwayProtocolDecoderTest.java
@@ -23,7 +23,7 @@ public class DwayProtocolDecoderTest extends ProtocolTest {
"AA55,1,123456,1,140101,101132,22.5500,113.6770,75,70.5,320,1100,0011,1110,3950,33000,24000,12345678"));
verifyNull(decoder, text(
- ">H12345678"));
+ "AA55,HB"));
}