|
|
|
@ -34,11 +34,13 @@ import org.thingsboard.server.common.data.EntityType; |
|
|
|
import org.thingsboard.server.common.data.device.credentials.BasicMqttCredentials; |
|
|
|
import org.thingsboard.server.common.data.device.credentials.lwm2m.LwM2MClientCredential; |
|
|
|
import org.thingsboard.server.common.data.device.credentials.lwm2m.LwM2MSecurityMode; |
|
|
|
import org.thingsboard.server.common.data.device.data.PowerMode; |
|
|
|
import org.thingsboard.server.common.data.device.profile.DefaultDeviceProfileConfiguration; |
|
|
|
import org.thingsboard.server.common.data.device.profile.DeviceProfileData; |
|
|
|
import org.thingsboard.server.common.data.device.profile.DeviceProfileTransportConfiguration; |
|
|
|
import org.thingsboard.server.common.data.device.profile.DisabledDeviceProfileProvisionConfiguration; |
|
|
|
import org.thingsboard.server.common.data.device.profile.Lwm2mDeviceProfileTransportConfiguration; |
|
|
|
import org.thingsboard.server.common.data.device.profile.lwm2m.OtherConfiguration; |
|
|
|
import org.thingsboard.server.common.data.device.profile.lwm2m.TelemetryMappingConfiguration; |
|
|
|
import org.thingsboard.server.common.data.id.TenantId; |
|
|
|
import org.thingsboard.server.common.data.security.DeviceCredentials; |
|
|
|
import org.thingsboard.server.common.data.security.DeviceCredentialsType; |
|
|
|
@ -52,6 +54,7 @@ import org.thingsboard.server.service.importing.BulkImportColumnType; |
|
|
|
import org.thingsboard.server.service.security.model.SecurityUser; |
|
|
|
|
|
|
|
import java.util.Collection; |
|
|
|
import java.util.Collections; |
|
|
|
import java.util.EnumSet; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.Objects; |
|
|
|
@ -225,11 +228,14 @@ public class DeviceBulkImportService extends AbstractBulkImportService<Device> { |
|
|
|
deviceProfile.setTransportType(DeviceTransportType.LWM2M); |
|
|
|
deviceProfile.setProvisionType(DeviceProfileProvisionType.DISABLED); |
|
|
|
|
|
|
|
Lwm2mDeviceProfileTransportConfiguration transportConfiguration = new Lwm2mDeviceProfileTransportConfiguration(); |
|
|
|
transportConfiguration.setBootstrap(Collections.emptyList()); |
|
|
|
transportConfiguration.setClientLwM2mSettings(new OtherConfiguration(1,1,1, PowerMode.DRX, null, null, null, null, null)); |
|
|
|
transportConfiguration.setObserveAttr(new TelemetryMappingConfiguration(Collections.emptyMap(), Collections.emptySet(), Collections.emptySet(), Collections.emptySet(), Collections.emptyMap())); |
|
|
|
|
|
|
|
DeviceProfileData deviceProfileData = new DeviceProfileData(); |
|
|
|
DefaultDeviceProfileConfiguration configuration = new DefaultDeviceProfileConfiguration(); |
|
|
|
DeviceProfileTransportConfiguration transportConfiguration = new Lwm2mDeviceProfileTransportConfiguration(); |
|
|
|
DisabledDeviceProfileProvisionConfiguration provisionConfiguration = new DisabledDeviceProfileProvisionConfiguration(null); |
|
|
|
|
|
|
|
deviceProfileData.setConfiguration(configuration); |
|
|
|
deviceProfileData.setTransportConfiguration(transportConfiguration); |
|
|
|
deviceProfileData.setProvisionConfiguration(provisionConfiguration); |
|
|
|
|