aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2021-05-30 11:55:10 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2021-05-30 11:55:10 -0700
commite90df8ad49cf71cdad1523be7e6ad50b86fc7158 (patch)
tree5cabac24f281eff87091ece674921deeb0619213 /src/main
parent5e4b1f4b5dc38bf03a305aefaad5ba30e652d8b8 (diff)
downloadtraccar-server-e90df8ad49cf71cdad1523be7e6ad50b86fc7158.tar.gz
traccar-server-e90df8ad49cf71cdad1523be7e6ad50b86fc7158.tar.bz2
traccar-server-e90df8ad49cf71cdad1523be7e6ad50b86fc7158.zip
Fix acknowledgement response
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/traccar/protocol/UuxProtocolDecoder.java5
1 files changed, 3 insertions, 2 deletions
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()));