From e90df8ad49cf71cdad1523be7e6ad50b86fc7158 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sun, 30 May 2021 11:55:10 -0700 Subject: Fix acknowledgement response --- src/main/java/org/traccar/protocol/UuxProtocolDecoder.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/main') diff --git a/src/main/java/org/traccar/protocol/UuxProtocolDecoder.java b/src/main/java/org/traccar/protocol/UuxProtocolDecoder.java index 8c00a8860..cb8656545 100644 --- a/src/main/java/org/traccar/protocol/UuxProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/UuxProtocolDecoder.java @@ -22,6 +22,7 @@ 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.DateBuilder; import org.traccar.model.Position; @@ -40,10 +41,10 @@ public class UuxProtocolDecoder extends BaseProtocolDecoder { public static final int MSG_NACK = 0xF0; private void sendResponse(Channel channel, int productCode, int protocolVersion, int type) { - if (channel != null) { + if (channel != null && BitUtil.check(protocolVersion, 7)) { ByteBuf response = Unpooled.buffer(); response.writeShort(productCode); - response.writeByte(protocolVersion); + response.writeByte(BitUtil.to(protocolVersion, 7)); response.writeByte(1); // length response.writeByte(type); channel.writeAndFlush(new NetworkMessage(response, channel.remoteAddress())); -- cgit v1.2.3