aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/java/org/traccar/protocol/WristbandProtocolDecoder.java12
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()));
}
}