|
|
@ -18,6 +18,7 @@ package org.thingsboard.server.common.transport.session; |
|
|
import lombok.Data; |
|
|
import lombok.Data; |
|
|
import lombok.Getter; |
|
|
import lombok.Getter; |
|
|
import lombok.Setter; |
|
|
import lombok.Setter; |
|
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import org.thingsboard.server.common.data.Device; |
|
|
import org.thingsboard.server.common.data.Device; |
|
|
import org.thingsboard.server.common.data.DeviceProfile; |
|
|
import org.thingsboard.server.common.data.DeviceProfile; |
|
|
import org.thingsboard.server.common.data.id.DeviceId; |
|
|
import org.thingsboard.server.common.data.id.DeviceId; |
|
|
@ -65,9 +66,14 @@ public abstract class DeviceAwareSessionContext implements SessionContext { |
|
|
this.sessionInfo = TransportProtos.SessionInfoProto.newBuilder().mergeFrom(sessionInfo).setDeviceType(deviceProfile.getName()).build(); |
|
|
this.sessionInfo = TransportProtos.SessionInfoProto.newBuilder().mergeFrom(sessionInfo).setDeviceType(deviceProfile.getName()).build(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Override |
|
|
public void onDeviceProfileUpdate(Device device) { |
|
|
public void onDeviceUpdate(Device device) { |
|
|
|
|
|
this.deviceInfo.setDeviceProfileId(device.getDeviceProfileId()); |
|
|
this.deviceInfo.setDeviceProfileId(device.getDeviceProfileId()); |
|
|
|
|
|
this.deviceInfo.setDeviceType(device.getType()); |
|
|
|
|
|
this.sessionInfo = TransportProtos.SessionInfoProto.newBuilder().mergeFrom(sessionInfo) |
|
|
|
|
|
.setDeviceProfileIdMSB(device.getDeviceProfileId().getId().getMostSignificantBits()) |
|
|
|
|
|
.setDeviceProfileIdLSB(device.getDeviceProfileId().getId().getLeastSignificantBits()) |
|
|
|
|
|
.setDeviceType(device.getType()) |
|
|
|
|
|
.build(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public boolean isConnected() { |
|
|
public boolean isConnected() { |
|
|
|