From 96834fd3ae449d5c47e53b0bcbcd68ec255dfd89 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Thu, 10 Jun 2021 22:13:01 -0700 Subject: Fix protocol response --- .../java/org/traccar/protocol/WristbandProtocolDecoder.java | 12 ++++-------- 1 file 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())); } } -- cgit v1.2.3