...
|
...
|
@@ -16,6 +16,7 @@ |
16
|
16
|
package org.thingsboard.server.transport.mqtt.session;
|
17
|
17
|
|
18
|
18
|
import lombok.extern.slf4j.Slf4j;
|
|
19
|
+import org.thingsboard.server.common.data.DeviceProfile;
|
19
|
20
|
import org.thingsboard.server.common.transport.SessionMsgListener;
|
20
|
21
|
import org.thingsboard.server.common.transport.auth.TransportDeviceInfo;
|
21
|
22
|
import org.thingsboard.server.gen.transport.TransportProtos;
|
...
|
...
|
@@ -32,7 +33,7 @@ import java.util.concurrent.ConcurrentMap; |
32
|
33
|
public class GatewayDeviceSessionCtx extends MqttDeviceAwareSessionContext implements SessionMsgListener {
|
33
|
34
|
|
34
|
35
|
private final GatewaySessionHandler parent;
|
35
|
|
- private final SessionInfoProto sessionInfo;
|
|
36
|
+ private volatile SessionInfoProto sessionInfo;
|
36
|
37
|
|
37
|
38
|
public GatewayDeviceSessionCtx(GatewaySessionHandler parent, TransportDeviceInfo deviceInfo, ConcurrentMap<MqttTopicMatcher, Integer> mqttQoSMap) {
|
38
|
39
|
super(UUID.randomUUID(), mqttQoSMap);
|
...
|
...
|
@@ -105,4 +106,10 @@ public class GatewayDeviceSessionCtx extends MqttDeviceAwareSessionContext imple |
105
|
106
|
public void onToServerRpcResponse(TransportProtos.ToServerRpcResponseMsg toServerResponse) {
|
106
|
107
|
// This feature is not supported in the TB IoT Gateway yet.
|
107
|
108
|
}
|
|
109
|
+
|
|
110
|
+ @Override
|
|
111
|
+ public void onProfileUpdate(DeviceProfile deviceProfile) {
|
|
112
|
+ deviceInfo.setDeviceType(deviceProfile.getName());
|
|
113
|
+ sessionInfo = SessionInfoProto.newBuilder().mergeFrom(sessionInfo).setDeviceType(deviceProfile.getName()).build();
|
|
114
|
+ }
|
108
|
115
|
} |
...
|
...
|
|