Search in sources :

Example 6 with LwM2mClient

use of org.thingsboard.server.transport.lwm2m.server.client.LwM2mClient in project thingsboard by thingsboard.

the class LwM2MTestClient method awaitClientAfterStartConnectLw.

private void awaitClientAfterStartConnectLw() {
    LwM2mClient lwM2MClient = this.clientContext.getClientByEndpoint(endpoint);
    CountDownLatch latch = new CountDownLatch(1);
    Mockito.doAnswer(invocation -> {
        latch.countDown();
        return null;
    }).when(defaultLwM2mUplinkMsgHandlerTest).initAttributes(lwM2MClient, true);
    try {
        if (!latch.await(1, TimeUnit.SECONDS)) {
            throw new RuntimeException("Failed to await TimeOut lwm2m client initialization!");
        }
    } catch (InterruptedException e) {
        throw new RuntimeException("Exception Failed to await lwm2m client initialization! ", e);
    }
}
Also used : CountDownLatch(java.util.concurrent.CountDownLatch) LwM2mClient(org.thingsboard.server.transport.lwm2m.server.client.LwM2mClient)

Example 7 with LwM2mClient

use of org.thingsboard.server.transport.lwm2m.server.client.LwM2mClient in project thingsboard by thingsboard.

the class LwM2MClientSerDes method deserialize.

@SneakyThrows
public static LwM2mClient deserialize(byte[] data) {
    JsonObject o = Json.parse(new String(data)).asObject();
    LwM2mClient lwM2mClient = new LwM2mClient(o.get("nodeId").asString(), o.get("endpoint").asString());
    o.get("resources").asObject().forEach(entry -> {
        JsonObject resource = entry.getValue().asObject();
        LwM2mResource lwM2mResource = parseLwM2mResource(resource.get("lwM2mResource").asObject());
        ResourceModel resourceModel = parseResourceModel(resource.get("resourceModel").asObject());
        ResourceValue resourceValue = new ResourceValue(lwM2mResource, resourceModel);
        lwM2mClient.getResources().put(entry.getName(), resourceValue);
    });
    for (JsonObject.Member entry : o.get("sharedAttributes").asObject()) {
        TransportProtos.TsKvProto.Builder builder = TransportProtos.TsKvProto.newBuilder();
        JsonFormat.parser().merge(entry.getValue().asString(), builder);
        lwM2mClient.getSharedAttributes().put(entry.getName(), builder.build());
    }
    o.get("keyTsLatestMap").asObject().forEach(entry -> {
        lwM2mClient.getKeyTsLatestMap().put(entry.getName(), new AtomicLong(entry.getValue().asLong()));
    });
    lwM2mClient.setState(LwM2MClientState.valueOf(o.get("state").asString()));
    Class<LwM2mClient> lwM2mClientClass = LwM2mClient.class;
    JsonValue session = o.get("session");
    if (session != null) {
        TransportProtos.SessionInfoProto.Builder builder = TransportProtos.SessionInfoProto.newBuilder();
        JsonFormat.parser().merge(session.asString(), builder);
        Field sessionField = lwM2mClientClass.getDeclaredField("session");
        sessionField.setAccessible(true);
        sessionField.set(lwM2mClient, builder.build());
    }
    JsonValue tenantId = o.get("tenantId");
    if (tenantId != null) {
        Field tenantIdField = lwM2mClientClass.getDeclaredField("tenantId");
        tenantIdField.setAccessible(true);
        tenantIdField.set(lwM2mClient, new TenantId(UUID.fromString(tenantId.asString())));
    }
    JsonValue deviceId = o.get("deviceId");
    if (tenantId != null) {
        Field deviceIdField = lwM2mClientClass.getDeclaredField("deviceId");
        deviceIdField.setAccessible(true);
        deviceIdField.set(lwM2mClient, UUID.fromString(deviceId.asString()));
    }
    JsonValue profileId = o.get("profileId");
    if (tenantId != null) {
        Field profileIdField = lwM2mClientClass.getDeclaredField("profileId");
        profileIdField.setAccessible(true);
        profileIdField.set(lwM2mClient, UUID.fromString(profileId.asString()));
    }
    JsonValue powerMode = o.get("powerMode");
    if (powerMode != null) {
        Field powerModeField = lwM2mClientClass.getDeclaredField("powerMode");
        powerModeField.setAccessible(true);
        powerModeField.set(lwM2mClient, PowerMode.valueOf(powerMode.asString()));
    }
    JsonValue edrxCycle = o.get("edrxCycle");
    if (edrxCycle != null) {
        Field edrxCycleField = lwM2mClientClass.getDeclaredField("edrxCycle");
        edrxCycleField.setAccessible(true);
        edrxCycleField.set(lwM2mClient, edrxCycle.asLong());
    }
    JsonValue psmActivityTimer = o.get("psmActivityTimer");
    if (psmActivityTimer != null) {
        Field psmActivityTimerField = lwM2mClientClass.getDeclaredField("psmActivityTimer");
        psmActivityTimerField.setAccessible(true);
        psmActivityTimerField.set(lwM2mClient, psmActivityTimer.asLong());
    }
    JsonValue pagingTransmissionWindow = o.get("pagingTransmissionWindow");
    if (pagingTransmissionWindow != null) {
        Field pagingTransmissionWindowField = lwM2mClientClass.getDeclaredField("pagingTransmissionWindow");
        pagingTransmissionWindowField.setAccessible(true);
        pagingTransmissionWindowField.set(lwM2mClient, pagingTransmissionWindow.asLong());
    }
    JsonValue registration = o.get("registration");
    if (registration != null) {
        lwM2mClient.setRegistration(RegistrationSerDes.deserialize(registration.asObject()));
    }
    lwM2mClient.setAsleep(o.get("asleep").asBoolean());
    Field lastUplinkTimeField = lwM2mClientClass.getDeclaredField("lastUplinkTime");
    lastUplinkTimeField.setAccessible(true);
    lastUplinkTimeField.setLong(lwM2mClient, o.get("lastUplinkTime").asLong());
    Field firstEdrxDownlinkField = lwM2mClientClass.getDeclaredField("firstEdrxDownlink");
    firstEdrxDownlinkField.setAccessible(true);
    firstEdrxDownlinkField.setBoolean(lwM2mClient, o.get("firstEdrxDownlink").asBoolean());
    lwM2mClient.getRetryAttempts().set(o.get("retryAttempts").asInt());
    JsonValue lastSentRpcId = o.get("lastSentRpcId");
    if (lastSentRpcId != null) {
        lwM2mClient.setLastSentRpcId(UUID.fromString(lastSentRpcId.asString()));
    }
    return lwM2mClient;
}
Also used : JsonValue(com.eclipsesource.json.JsonValue) JsonObject(com.eclipsesource.json.JsonObject) LwM2mResource(org.eclipse.leshan.core.node.LwM2mResource) Field(java.lang.reflect.Field) AtomicLong(java.util.concurrent.atomic.AtomicLong) TenantId(org.thingsboard.server.common.data.id.TenantId) ResourceValue(org.thingsboard.server.transport.lwm2m.server.client.ResourceValue) ResourceModel(org.eclipse.leshan.core.model.ResourceModel) LwM2mClient(org.thingsboard.server.transport.lwm2m.server.client.LwM2mClient) SneakyThrows(lombok.SneakyThrows)

Example 8 with LwM2mClient

use of org.thingsboard.server.transport.lwm2m.server.client.LwM2mClient in project thingsboard by thingsboard.

the class DefaultLwM2mUplinkMsgHandler method onUpdateValueAfterReadCompositeResponse.

public void onUpdateValueAfterReadCompositeResponse(Registration registration, ReadCompositeResponse response) {
    log.trace("ReadCompositeResponse: [{}]", response);
    if (response.getContent() != null) {
        LwM2mClient lwM2MClient = clientContext.getClientByEndpoint(registration.getEndpoint());
        response.getContent().forEach((k, v) -> {
            if (v != null) {
                int responseCode = response.getCode().getCode();
                if (v instanceof LwM2mObject) {
                    this.updateObjectResourceValue(lwM2MClient, (LwM2mObject) v, k.toString(), responseCode);
                } else if (v instanceof LwM2mObjectInstance) {
                    this.updateObjectInstanceResourceValue(lwM2MClient, (LwM2mObjectInstance) v, k.toString(), responseCode);
                } else if (v instanceof LwM2mResource) {
                    this.updateResourcesValue(lwM2MClient, (LwM2mResource) v, k.toString(), Mode.UPDATE, responseCode);
                }
            }
        });
        clientContext.update(lwM2MClient);
        if (clientContext.awake(lwM2MClient)) {
            // clientContext.awake calls clientContext.update
            log.debug("[{}] Device is awake", lwM2MClient.getEndpoint());
        } else {
            clientContext.update(lwM2MClient);
        }
    }
}
Also used : LwM2mObjectInstance(org.eclipse.leshan.core.node.LwM2mObjectInstance) LwM2mObject(org.eclipse.leshan.core.node.LwM2mObject) LwM2mResource(org.eclipse.leshan.core.node.LwM2mResource) LwM2mClient(org.thingsboard.server.transport.lwm2m.server.client.LwM2mClient)

Example 9 with LwM2mClient

use of org.thingsboard.server.transport.lwm2m.server.client.LwM2mClient in project thingsboard by thingsboard.

the class DefaultLwM2mUplinkMsgHandler method onUpdateValueAfterReadResponse.

/**
 * Sending observe value to thingsboard from ObservationListener.onResponse: object, instance, SingleResource or MultipleResource
 *
 * @param registration - Registration LwM2M Client
 * @param path         - observe
 * @param response     - observe
 */
@Override
public void onUpdateValueAfterReadResponse(Registration registration, String path, ReadResponse response) {
    LwM2mNode content = response.getContent();
    if (content != null) {
        LwM2mClient lwM2MClient = clientContext.getClientByEndpoint(registration.getEndpoint());
        ObjectModel objectModelVersion = lwM2MClient.getObjectModel(path, modelProvider);
        if (objectModelVersion != null) {
            int responseCode = response.getCode().getCode();
            if (content instanceof LwM2mObject) {
                LwM2mObject lwM2mObject = (LwM2mObject) content;
                this.updateObjectResourceValue(lwM2MClient, lwM2mObject, path, responseCode);
            } else if (content instanceof LwM2mObjectInstance) {
                LwM2mObjectInstance lwM2mObjectInstance = (LwM2mObjectInstance) content;
                this.updateObjectInstanceResourceValue(lwM2MClient, lwM2mObjectInstance, path, responseCode);
            } else if (content instanceof LwM2mResource) {
                LwM2mResource lwM2mResource = (LwM2mResource) content;
                this.updateResourcesValue(lwM2MClient, lwM2mResource, path, Mode.UPDATE, responseCode);
            }
        }
        if (clientContext.awake(lwM2MClient)) {
            // clientContext.awake calls clientContext.update
            log.debug("[{}] Device is awake", lwM2MClient.getEndpoint());
        } else {
            clientContext.update(lwM2MClient);
        }
    }
}
Also used : LwM2mObjectInstance(org.eclipse.leshan.core.node.LwM2mObjectInstance) ObjectModel(org.eclipse.leshan.core.model.ObjectModel) LwM2mObject(org.eclipse.leshan.core.node.LwM2mObject) LwM2mNode(org.eclipse.leshan.core.node.LwM2mNode) LwM2mResource(org.eclipse.leshan.core.node.LwM2mResource) LwM2mClient(org.thingsboard.server.transport.lwm2m.server.client.LwM2mClient)

Example 10 with LwM2mClient

use of org.thingsboard.server.transport.lwm2m.server.client.LwM2mClient in project thingsboard by thingsboard.

the class DefaultLwM2mUplinkMsgHandler method onDeviceProfileUpdate.

// TODO: review and optimize the logic to minimize number of the requests to device.
private void onDeviceProfileUpdate(List<LwM2mClient> clients, Lwm2mDeviceProfileTransportConfiguration oldProfile, DeviceProfile deviceProfile) {
    if (clientContext.profileUpdate(deviceProfile) != null) {
        TelemetryMappingConfiguration oldTelemetryParams = oldProfile.getObserveAttr();
        Set<String> attributeSetOld = oldTelemetryParams.getAttribute();
        Set<String> telemetrySetOld = oldTelemetryParams.getTelemetry();
        Set<String> observeOld = oldTelemetryParams.getObserve();
        Map<String, String> keyNameOld = oldTelemetryParams.getKeyName();
        Map<String, ObjectAttributes> attributeLwm2mOld = oldTelemetryParams.getAttributeLwm2m();
        var newProfile = clientContext.getProfile(deviceProfile.getUuidId());
        TelemetryMappingConfiguration newTelemetryParams = newProfile.getObserveAttr();
        Set<String> attributeSetNew = newTelemetryParams.getAttribute();
        Set<String> telemetrySetNew = newTelemetryParams.getTelemetry();
        Set<String> observeNew = newTelemetryParams.getObserve();
        Map<String, String> keyNameNew = newTelemetryParams.getKeyName();
        Map<String, ObjectAttributes> attributeLwm2mNew = newTelemetryParams.getAttributeLwm2m();
        Set<String> observeToAdd = diffSets(observeOld, observeNew);
        Set<String> observeToRemove = diffSets(observeNew, observeOld);
        Set<String> newObjectsToRead = new HashSet<>();
        Set<String> newObjectsToCancelRead = new HashSet<>();
        if (!attributeSetOld.equals(attributeSetNew)) {
            newObjectsToRead.addAll(diffSets(attributeSetOld, attributeSetNew));
            newObjectsToCancelRead.addAll(diffSets(attributeSetNew, attributeSetOld));
        }
        if (!telemetrySetOld.equals(telemetrySetNew)) {
            newObjectsToRead.addAll(diffSets(telemetrySetOld, telemetrySetNew));
            newObjectsToCancelRead.addAll(diffSets(telemetrySetNew, telemetrySetOld));
        }
        if (!keyNameOld.equals(keyNameNew)) {
            ParametersAnalyzeResult keyNameChange = this.getAnalyzerKeyName(keyNameOld, keyNameNew);
            newObjectsToRead.addAll(keyNameChange.getPathPostParametersAdd());
        }
        ParametersAnalyzeResult analyzerParameters = getAttributesAnalyzer(attributeLwm2mOld, attributeLwm2mNew);
        clients.forEach(client -> {
            LwM2MModelConfig modelConfig = new LwM2MModelConfig(client.getEndpoint());
            modelConfig.getToRead().addAll(diffSets(observeToAdd, newObjectsToRead));
            modelConfig.getToCancelRead().addAll(newObjectsToCancelRead);
            modelConfig.getToCancelObserve().addAll(observeToRemove);
            modelConfig.getToObserve().addAll(observeToAdd);
            Set<String> clientObjects = clientContext.getSupportedIdVerInClient(client);
            Set<String> pathToAdd = analyzerParameters.getPathPostParametersAdd().stream().filter(target -> clientObjects.contains("/" + target.split(LWM2M_SEPARATOR_PATH)[1])).collect(Collectors.toUnmodifiableSet());
            modelConfig.getAttributesToAdd().putAll(pathToAdd.stream().collect(Collectors.toMap(t -> t, attributeLwm2mNew::get)));
            Set<String> pathToRemove = analyzerParameters.getPathPostParametersDel().stream().filter(target -> clientObjects.contains("/" + target.split(LWM2M_SEPARATOR_PATH)[1])).collect(Collectors.toUnmodifiableSet());
            modelConfig.getAttributesToRemove().addAll(pathToRemove);
            modelConfigService.sendUpdates(client, modelConfig);
        });
        // update value in fwInfo
        OtherConfiguration newLwM2mSettings = newProfile.getClientLwM2mSettings();
        OtherConfiguration oldLwM2mSettings = oldProfile.getClientLwM2mSettings();
        if (!newLwM2mSettings.getFwUpdateStrategy().equals(oldLwM2mSettings.getFwUpdateStrategy()) || (StringUtils.isNotEmpty(newLwM2mSettings.getFwUpdateResource()) && !newLwM2mSettings.getFwUpdateResource().equals(oldLwM2mSettings.getFwUpdateResource()))) {
            clients.forEach(lwM2MClient -> otaService.onFirmwareStrategyUpdate(lwM2MClient, newLwM2mSettings));
        }
        if (!newLwM2mSettings.getSwUpdateStrategy().equals(oldLwM2mSettings.getSwUpdateStrategy()) || (StringUtils.isNotEmpty(newLwM2mSettings.getSwUpdateResource()) && !newLwM2mSettings.getSwUpdateResource().equals(oldLwM2mSettings.getSwUpdateResource()))) {
            clients.forEach(lwM2MClient -> otaService.onCurrentSoftwareStrategyUpdate(lwM2MClient, newLwM2mSettings));
        }
    }
}
Also used : LwM2MTransportServerConfig(org.thingsboard.server.transport.lwm2m.config.LwM2MTransportServerConfig) LwM2MTelemetryLogService(org.thingsboard.server.transport.lwm2m.server.log.LwM2MTelemetryLogService) TypeToken(com.google.gson.reflect.TypeToken) SW_VER_ID(org.thingsboard.server.transport.lwm2m.server.ota.DefaultLwM2MOtaUpdateService.SW_VER_ID) TbLwM2MLatchCallback(org.thingsboard.server.transport.lwm2m.server.downlink.TbLwM2MLatchCallback) LwM2MSessionManager(org.thingsboard.server.transport.lwm2m.server.session.LwM2MSessionManager) CreateRequest(org.eclipse.leshan.core.request.CreateRequest) TbLwM2MReadRequest(org.thingsboard.server.transport.lwm2m.server.downlink.TbLwM2MReadRequest) LwM2MModelConfig(org.thingsboard.server.transport.lwm2m.server.model.LwM2MModelConfig) GsonBuilder(com.google.gson.GsonBuilder) TenantId(org.thingsboard.server.common.data.id.TenantId) LwM2MExecutorAwareService(org.thingsboard.server.transport.lwm2m.server.common.LwM2MExecutorAwareService) TbLwM2MReadCallback(org.thingsboard.server.transport.lwm2m.server.downlink.TbLwM2MReadCallback) Observation(org.eclipse.leshan.core.observation.Observation) Map(java.util.Map) SW_3_VER_ID(org.thingsboard.server.transport.lwm2m.server.ota.DefaultLwM2MOtaUpdateService.SW_3_VER_ID) LwM2mClientContext(org.thingsboard.server.transport.lwm2m.server.client.LwM2mClientContext) DeviceProfile(org.thingsboard.server.common.data.DeviceProfile) TbLwM2mSecurityStore(org.thingsboard.server.transport.lwm2m.server.store.TbLwM2mSecurityStore) StringUtils(org.thingsboard.server.common.data.StringUtils) OtaPackageUtil(org.thingsboard.server.common.data.ota.OtaPackageUtil) Set(java.util.Set) FW_RESULT_ID(org.thingsboard.server.transport.lwm2m.server.ota.DefaultLwM2MOtaUpdateService.FW_RESULT_ID) TbLwM2MWriteAttributesRequest(org.thingsboard.server.transport.lwm2m.server.downlink.TbLwM2MWriteAttributesRequest) CountDownLatch(java.util.concurrent.CountDownLatch) Slf4j(lombok.extern.slf4j.Slf4j) LOG_LWM2M_INFO(org.thingsboard.server.transport.lwm2m.utils.LwM2MTransportUtil.LOG_LWM2M_INFO) TransportProtos(org.thingsboard.server.gen.transport.TransportProtos) Lazy(org.springframework.context.annotation.Lazy) LwM2MTransportUtil(org.thingsboard.server.transport.lwm2m.utils.LwM2MTransportUtil) ResourceModel(org.eclipse.leshan.core.model.ResourceModel) LwM2mClient(org.thingsboard.server.transport.lwm2m.server.client.LwM2mClient) LwM2mSingleResource(org.eclipse.leshan.core.node.LwM2mSingleResource) OtherConfiguration(org.thingsboard.server.common.data.device.profile.lwm2m.OtherConfiguration) LwM2mVersionedModelProvider(org.thingsboard.server.transport.lwm2m.server.LwM2mVersionedModelProvider) TransportServiceCallback(org.thingsboard.server.common.transport.TransportServiceCallback) Device(org.thingsboard.server.common.data.Device) TbLwM2mTransportComponent(org.thingsboard.server.queue.util.TbLwM2mTransportComponent) ArrayList(java.util.ArrayList) Mode(org.eclipse.leshan.core.request.WriteRequest.Mode) TbLwM2MObserveCallback(org.thingsboard.server.transport.lwm2m.server.downlink.TbLwM2MObserveCallback) ReadCompositeResponse(org.eclipse.leshan.core.response.ReadCompositeResponse) Service(org.springframework.stereotype.Service) LwM2MModelConfigService(org.thingsboard.server.transport.lwm2m.server.model.LwM2MModelConfigService) ParametersAnalyzeResult(org.thingsboard.server.transport.lwm2m.server.client.ParametersAnalyzeResult) ObserveRequest(org.eclipse.leshan.core.request.ObserveRequest) TelemetryMappingConfiguration(org.thingsboard.server.common.data.device.profile.lwm2m.TelemetryMappingConfiguration) Lwm2mDeviceProfileTransportConfiguration(org.thingsboard.server.common.data.device.profile.Lwm2mDeviceProfileTransportConfiguration) LOG_LWM2M_ERROR(org.thingsboard.server.transport.lwm2m.utils.LwM2MTransportUtil.LOG_LWM2M_ERROR) ReadResponse(org.eclipse.leshan.core.response.ReadResponse) LwM2MTransportUtil.convertOtaUpdateValueToString(org.thingsboard.server.transport.lwm2m.utils.LwM2MTransportUtil.convertOtaUpdateValueToString) FW_STATE_ID(org.thingsboard.server.transport.lwm2m.server.ota.DefaultLwM2MOtaUpdateService.FW_STATE_ID) LwM2mOtaConvert(org.thingsboard.server.transport.lwm2m.server.LwM2mOtaConvert) LOG_LWM2M_WARN(org.thingsboard.server.transport.lwm2m.utils.LwM2MTransportUtil.LOG_LWM2M_WARN) LwM2mResource(org.eclipse.leshan.core.node.LwM2mResource) LwM2MOtaUpdateService(org.thingsboard.server.transport.lwm2m.server.ota.LwM2MOtaUpdateService) LwM2mValueConverterImpl(org.thingsboard.server.transport.lwm2m.utils.LwM2mValueConverterImpl) FW_DELIVERY_METHOD(org.thingsboard.server.transport.lwm2m.server.ota.DefaultLwM2MOtaUpdateService.FW_DELIVERY_METHOD) LwM2MTransportUtil.fromVersionedIdToObjectId(org.thingsboard.server.transport.lwm2m.utils.LwM2MTransportUtil.fromVersionedIdToObjectId) FW_3_VER_ID(org.thingsboard.server.transport.lwm2m.server.ota.DefaultLwM2MOtaUpdateService.FW_3_VER_ID) LwM2MAttributesService(org.thingsboard.server.transport.lwm2m.server.attributes.LwM2MAttributesService) LwM2mTransportServerHelper(org.thingsboard.server.transport.lwm2m.server.LwM2mTransportServerHelper) LwM2mObjectInstance(org.eclipse.leshan.core.node.LwM2mObjectInstance) JsonObject(com.google.gson.JsonObject) ReadRequest(org.eclipse.leshan.core.request.ReadRequest) DonAsynchron(org.thingsboard.common.util.DonAsynchron) LwM2MTransportUtil.convertObjectIdToVersionedId(org.thingsboard.server.transport.lwm2m.utils.LwM2MTransportUtil.convertObjectIdToVersionedId) TbLwM2MWriteAttributesCallback(org.thingsboard.server.transport.lwm2m.server.downlink.TbLwM2MWriteAttributesCallback) LwM2mPath(org.eclipse.leshan.core.node.LwM2mPath) Random(java.util.Random) ObserveResponse(org.eclipse.leshan.core.response.ObserveResponse) DownlinkRequestCallback(org.thingsboard.server.transport.lwm2m.server.downlink.DownlinkRequestCallback) LwM2mTransportContext(org.thingsboard.server.transport.lwm2m.server.LwM2mTransportContext) PreDestroy(javax.annotation.PreDestroy) LwM2MClientState(org.thingsboard.server.transport.lwm2m.server.client.LwM2MClientState) Registration(org.eclipse.leshan.server.registration.Registration) Gson(com.google.gson.Gson) ResultsAddKeyValueProto(org.thingsboard.server.transport.lwm2m.server.client.ResultsAddKeyValueProto) SW_STATE_ID(org.thingsboard.server.transport.lwm2m.server.ota.DefaultLwM2MOtaUpdateService.SW_STATE_ID) FW_NAME_ID(org.thingsboard.server.transport.lwm2m.server.ota.DefaultLwM2MOtaUpdateService.FW_NAME_ID) LWM2M_SEPARATOR_PATH(org.thingsboard.server.common.data.lwm2m.LwM2mConstants.LWM2M_SEPARATOR_PATH) LwM2mMultipleResource(org.eclipse.leshan.core.node.LwM2mMultipleResource) DeviceId(org.thingsboard.server.common.data.id.DeviceId) LwM2mDownlinkMsgHandler(org.thingsboard.server.transport.lwm2m.server.downlink.LwM2mDownlinkMsgHandler) SW_NAME_ID(org.thingsboard.server.transport.lwm2m.server.ota.DefaultLwM2MOtaUpdateService.SW_NAME_ID) ResponseCode(org.eclipse.leshan.core.ResponseCode) LwM2MClientStateException(org.thingsboard.server.transport.lwm2m.server.client.LwM2MClientStateException) Collection(java.util.Collection) LwM2mNode(org.eclipse.leshan.core.node.LwM2mNode) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) UUID(java.util.UUID) TransportService(org.thingsboard.server.common.transport.TransportService) Collectors(java.util.stream.Collectors) CollectionsUtil.diffSets(org.thingsboard.common.util.CollectionsUtil.diffSets) FW_VER_ID(org.thingsboard.server.transport.lwm2m.server.ota.DefaultLwM2MOtaUpdateService.FW_VER_ID) List(java.util.List) PostConstruct(javax.annotation.PostConstruct) TbLwM2MObserveRequest(org.thingsboard.server.transport.lwm2m.server.downlink.TbLwM2MObserveRequest) Optional(java.util.Optional) TbLwM2MDtlsSessionStore(org.thingsboard.server.transport.lwm2m.server.store.TbLwM2MDtlsSessionStore) TbLwM2MCancelObserveCallback(org.thingsboard.server.transport.lwm2m.server.downlink.TbLwM2MCancelObserveCallback) ObjectAttributes(org.thingsboard.server.common.data.device.profile.lwm2m.ObjectAttributes) SW_RESULT_ID(org.thingsboard.server.transport.lwm2m.server.ota.DefaultLwM2MOtaUpdateService.SW_RESULT_ID) JsonElement(com.google.gson.JsonElement) HashSet(java.util.HashSet) WriteRequest(org.eclipse.leshan.core.request.WriteRequest) TbLwM2MCancelObserveRequest(org.thingsboard.server.transport.lwm2m.server.downlink.TbLwM2MCancelObserveRequest) SessionInfoProto(org.thingsboard.server.gen.transport.TransportProtos.SessionInfoProto) LwM2mObject(org.eclipse.leshan.core.node.LwM2mObject) WriteCompositeRequest(org.eclipse.leshan.core.request.WriteCompositeRequest) TimeUnit(java.util.concurrent.TimeUnit) LwM2mResourceInstance(org.eclipse.leshan.core.node.LwM2mResourceInstance) ObjectModel(org.eclipse.leshan.core.model.ObjectModel) RegistrationStore(org.eclipse.leshan.server.registration.RegistrationStore) Collections(java.util.Collections) OtherConfiguration(org.thingsboard.server.common.data.device.profile.lwm2m.OtherConfiguration) ParametersAnalyzeResult(org.thingsboard.server.transport.lwm2m.server.client.ParametersAnalyzeResult) TelemetryMappingConfiguration(org.thingsboard.server.common.data.device.profile.lwm2m.TelemetryMappingConfiguration) ObjectAttributes(org.thingsboard.server.common.data.device.profile.lwm2m.ObjectAttributes) LwM2MTransportUtil.convertOtaUpdateValueToString(org.thingsboard.server.transport.lwm2m.utils.LwM2MTransportUtil.convertOtaUpdateValueToString) LwM2MModelConfig(org.thingsboard.server.transport.lwm2m.server.model.LwM2MModelConfig) HashSet(java.util.HashSet)

Aggregations

LwM2mClient (org.thingsboard.server.transport.lwm2m.server.client.LwM2mClient)13 LwM2mResource (org.eclipse.leshan.core.node.LwM2mResource)6 ResourceModel (org.eclipse.leshan.core.model.ResourceModel)4 LwM2MClientStateException (org.thingsboard.server.transport.lwm2m.server.client.LwM2MClientStateException)4 ArrayList (java.util.ArrayList)3 UUID (java.util.UUID)3 ObjectModel (org.eclipse.leshan.core.model.ObjectModel)3 LwM2mObject (org.eclipse.leshan.core.node.LwM2mObject)3 LwM2mObjectInstance (org.eclipse.leshan.core.node.LwM2mObjectInstance)3 Gson (com.google.gson.Gson)2 GsonBuilder (com.google.gson.GsonBuilder)2 JsonElement (com.google.gson.JsonElement)2 JsonObject (com.google.gson.JsonObject)2 Collection (java.util.Collection)2 HashSet (java.util.HashSet)2 List (java.util.List)2 Map (java.util.Map)2 Set (java.util.Set)2 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)2 CountDownLatch (java.util.concurrent.CountDownLatch)2