Merge branch 'develop/3.2' of github.com:thingsboard/thingsboard into develop/3.2
This commit is contained in:
commit
192fa0796e
@ -514,7 +514,7 @@ public class MqttTransportHandler extends ChannelInboundHandlerAdapter implement
|
||||
ctx.close();
|
||||
} else {
|
||||
deviceSessionCtx.setDeviceInfo(msg.getDeviceInfo());
|
||||
// deviceSessionCtx.setProfile(msg.getDeviceProfile());
|
||||
deviceSessionCtx.setDeviceProfile(msg.getDeviceProfile());
|
||||
sessionInfo = SessionInfoCreator.create(msg, context, sessionId);
|
||||
transportService.process(sessionInfo, DefaultTransportService.getSessionEventMsg(SessionEvent.OPEN), new TransportServiceCallback<Void>() {
|
||||
@Override
|
||||
|
||||
@ -35,7 +35,7 @@ public class GatewayDeviceSessionCtx extends MqttDeviceAwareSessionContext imple
|
||||
private final GatewaySessionHandler parent;
|
||||
private volatile SessionInfoProto sessionInfo;
|
||||
|
||||
public GatewayDeviceSessionCtx(GatewaySessionHandler parent, TransportDeviceInfo deviceInfo, ConcurrentMap<MqttTopicMatcher, Integer> mqttQoSMap) {
|
||||
public GatewayDeviceSessionCtx(GatewaySessionHandler parent, TransportDeviceInfo deviceInfo, DeviceProfile deviceProfile, ConcurrentMap<MqttTopicMatcher, Integer> mqttQoSMap) {
|
||||
super(UUID.randomUUID(), mqttQoSMap);
|
||||
this.parent = parent;
|
||||
this.sessionInfo = SessionInfoProto.newBuilder()
|
||||
@ -54,6 +54,7 @@ public class GatewayDeviceSessionCtx extends MqttDeviceAwareSessionContext imple
|
||||
.setDeviceProfileIdLSB(deviceInfo.getDeviceProfileId().getId().getLeastSignificantBits())
|
||||
.build();
|
||||
setDeviceInfo(deviceInfo);
|
||||
setDeviceProfile(deviceProfile);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -147,7 +147,7 @@ public class GatewaySessionHandler {
|
||||
new TransportServiceCallback<GetOrCreateDeviceFromGatewayResponse>() {
|
||||
@Override
|
||||
public void onSuccess(GetOrCreateDeviceFromGatewayResponse msg) {
|
||||
GatewayDeviceSessionCtx deviceSessionCtx = new GatewayDeviceSessionCtx(GatewaySessionHandler.this, msg.getDeviceInfo(), mqttQoSMap);
|
||||
GatewayDeviceSessionCtx deviceSessionCtx = new GatewayDeviceSessionCtx(GatewaySessionHandler.this, msg.getDeviceInfo(), msg.getDeviceProfile(), mqttQoSMap);
|
||||
if (devices.putIfAbsent(deviceName, deviceSessionCtx) == null) {
|
||||
log.trace("[{}] First got or created device [{}], type [{}] for the gateway session", sessionId, deviceName, deviceType);
|
||||
SessionInfoProto deviceSessionInfo = deviceSessionCtx.getSessionInfo();
|
||||
|
||||
@ -17,6 +17,8 @@ package org.thingsboard.server.common.transport.session;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.thingsboard.server.common.data.DeviceProfile;
|
||||
import org.thingsboard.server.common.data.id.DeviceId;
|
||||
import org.thingsboard.server.common.msg.session.SessionContext;
|
||||
import org.thingsboard.server.common.transport.auth.TransportDeviceInfo;
|
||||
@ -36,6 +38,10 @@ public abstract class DeviceAwareSessionContext implements SessionContext {
|
||||
private volatile DeviceId deviceId;
|
||||
@Getter
|
||||
protected volatile TransportDeviceInfo deviceInfo;
|
||||
@Getter
|
||||
@Setter
|
||||
protected volatile DeviceProfile deviceProfile;
|
||||
|
||||
private volatile boolean connected;
|
||||
|
||||
public DeviceId getDeviceId() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user