Browse Source

fix_bug: lwm2m Bootstrap ShortServerId

pull/10978/head
nick 2 years ago
parent
commit
4aa4f0f3e5
  1. 4
      dao/src/main/java/org/thingsboard/server/dao/service/validator/DeviceProfileDataValidator.java

4
dao/src/main/java/org/thingsboard/server/dao/service/validator/DeviceProfileDataValidator.java

@ -330,9 +330,7 @@ public class DeviceProfileDataValidator extends AbstractHasOtaPackageValidator<D
if (!serverConfig.isBootstrapServerIs() && (serverConfig.getShortServerId() < 1 || serverConfig.getShortServerId() > 65534)) {
throw new DeviceCredentialsValidationException("LwM2M Server ShortServerId must not be less than 1 and more than 65534!");
}
if (serverConfig.isBootstrapServerIs() && !(serverConfig.getShortServerId() == null || serverConfig.getShortServerId() ==0)) {
throw new DeviceCredentialsValidationException("Bootstrap Server ShortServerId must be null or '0'!");
}
String server = serverConfig.isBootstrapServerIs() ? "Bootstrap Server" : "LwM2M Server";
if (!shortServerIds.add(serverConfig.getShortServerId())) {
throw new DeviceCredentialsValidationException(server + " \"Short server Id\" value = " + serverConfig.getShortServerId() + ". This value must be a unique value for all servers!");

Loading…
Cancel
Save