Fix for QoS 0

This commit is contained in:
Volodymyr Babak 2018-06-05 16:15:46 +03:00
parent 75c0c5b3d0
commit b0acf23c6d

View File

@ -86,7 +86,7 @@ public class GatewayDeviceSessionCtx extends DeviceAwareSessionContext {
if (responseMsg.isSuccess()) { if (responseMsg.isSuccess()) {
SessionMsgType requestMsgType = responseMsg.getRequestMsgType(); SessionMsgType requestMsgType = responseMsg.getRequestMsgType();
Integer requestId = responseMsg.getRequestId(); Integer requestId = responseMsg.getRequestId();
if (requestId >= 0 && requestMsgType == SessionMsgType.POST_ATTRIBUTES_REQUEST || requestMsgType == SessionMsgType.POST_TELEMETRY_REQUEST) { if (requestId >= 0 && (requestMsgType == SessionMsgType.POST_ATTRIBUTES_REQUEST || requestMsgType == SessionMsgType.POST_TELEMETRY_REQUEST)) {
return Optional.of(MqttTransportHandler.createMqttPubAckMsg(requestId)); return Optional.of(MqttTransportHandler.createMqttPubAckMsg(requestId));
} }
} }