sparkplug: connection5

This commit is contained in:
nickAS21 2022-12-20 11:37:59 +02:00
parent f6aa9e6125
commit ee819e2d80
3 changed files with 6 additions and 11 deletions

View File

@ -47,6 +47,7 @@ import org.thingsboard.server.common.data.DeviceProfile;
import org.thingsboard.server.common.data.DeviceTransportType;
import org.thingsboard.server.common.data.StringUtils;
import org.thingsboard.server.common.data.TransportPayloadType;
import org.thingsboard.server.common.data.device.profile.MqttDeviceProfileTransportConfiguration;
import org.thingsboard.server.common.data.device.profile.MqttTopics;
import org.thingsboard.server.common.data.id.DeviceId;
import org.thingsboard.server.common.data.id.OtaPackageId;
@ -979,7 +980,11 @@ public class MqttTransportHandler extends ChannelInboundHandlerAdapter implement
}
private void checkSparkPlugSession(SessionMetaData sessionMetaData, MqttConnectMessage connectMessage) {
if (deviceSessionCtx.isSparkplug()) {
if (((MqttDeviceProfileTransportConfiguration) deviceSessionCtx
.getDeviceProfile()
.getProfileData()
.getTransportConfiguration())
.isSparkPlug()) {
TransportDeviceInfo device = deviceSessionCtx.getDeviceInfo();
try {
JsonNode infoNode = context.getMapper().readTree(device.getAdditionalInfo());

View File

@ -255,8 +255,4 @@ public class DeviceSessionCtx extends MqttDeviceAwareSessionContext {
return Collections.unmodifiableCollection(msgQueue);
}
public boolean isSparkplug () {
return ((MqttDeviceProfileTransportConfiguration) this.getDeviceProfile().getProfileData().getTransportConfiguration()).isSparkPlug();
}
}

View File

@ -15,12 +15,6 @@
*/
syntax = "proto3";
//
// To compile:
// cd client_libraries/java
// protoc --proto_path=../../ --java_out=src/main/java ../../sparkplug_b.proto
//
//package com.cirruslink.sparkplug.protobuf;
import "google/protobuf/any.proto";