diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2021-06-10 22:13:01 -0700 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2021-06-10 22:13:01 -0700 |
commit | 96834fd3ae449d5c47e53b0bcbcd68ec255dfd89 (patch) | |
tree | 2ba744315fe632e3bba87f42176d437b341b09b2 | |
parent | 2202e638a37e221c16b869465bbeebdfb3a72b20 (diff) | |
download | traccar-server-96834fd3ae449d5c47e53b0bcbcd68ec255dfd89.tar.gz traccar-server-96834fd3ae449d5c47e53b0bcbcd68ec255dfd89.tar.bz2 traccar-server-96834fd3ae449d5c47e53b0bcbcd68ec255dfd89.zip |
Fix protocol response
-rw-r--r-- | src/main/java/org/traccar/protocol/WristbandProtocolDecoder.java | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/main/java/org/traccar/protocol/WristbandProtocolDecoder.java b/src/main/java/org/traccar/protocol/WristbandProtocolDecoder.java index 7f2b0af85..58b5784d0 100644 --- a/src/main/java/org/traccar/protocol/WristbandProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/WristbandProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 Anton Tananaev (anton@traccar.org) + * Copyright 2018 - 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. @@ -51,14 +51,10 @@ public class WristbandProtocolDecoder extends BaseProtocolDecoder { if (channel != null) { String sentence = String.format("YX%s|%s|0|{F%02d#%s}\r\n", imei, version, type, data); ByteBuf response = Unpooled.buffer(); - if (type != 91) { - response.writeBytes(new byte[]{0x00, 0x01, 0x02}); - response.writeShort(sentence.length()); - } + response.writeBytes(new byte[]{0x00, 0x01, 0x02}); + response.writeShort(sentence.length()); response.writeCharSequence(sentence, StandardCharsets.US_ASCII); - if (type != 91) { - response.writeBytes(new byte[]{(byte) 0xFF, (byte) 0xFE, (byte) 0xFC}); - } + response.writeBytes(new byte[]{(byte) 0xFF, (byte) 0xFE, (byte) 0xFC}); channel.writeAndFlush(new NetworkMessage(response, channel.remoteAddress())); } } |