Browse Source

DeviceAwareSessionContext refactored: setDeviceInfo splitted into setDeviceInfo and setConnected to able to set connected status on callback after device info already set.

pull/5039/head
Sergey Matvienko 5 years ago
committed by Andrew Shvayka
parent
commit
1f1f7e3456
  1. 1
      common/transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/session/GatewayDeviceSessionCtx.java
  2. 1
      common/transport/snmp/src/main/java/org/thingsboard/server/transport/snmp/SnmpTransportContext.java

1
common/transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/session/GatewayDeviceSessionCtx.java

@ -60,6 +60,7 @@ public class GatewayDeviceSessionCtx extends MqttDeviceAwareSessionContext imple
.setDeviceProfileIdLSB(deviceInfo.getDeviceProfileId().getId().getLeastSignificantBits())
.build());
setDeviceInfo(deviceInfo);
setConnected(true);
setDeviceProfile(deviceProfile);
this.transportService = transportService;
}

1
common/transport/snmp/src/main/java/org/thingsboard/server/transport/snmp/SnmpTransportContext.java

@ -188,6 +188,7 @@ public class SnmpTransportContext extends TransportContext {
deviceSessionContext.setSessionInfo(sessionInfo);
deviceSessionContext.setDeviceInfo(msg.getDeviceInfo());
deviceSessionContext.setConnected(true);
} else {
log.warn("[{}] Failed to process device auth", deviceSessionContext.getDeviceId());
}

Loading…
Cancel
Save