Search in sources :

Example 1 with WriteCompositeRequest

use of org.eclipse.leshan.core.request.WriteCompositeRequest in project thingsboard by thingsboard.

the class DefaultLwM2mDownlinkMsgHandler method sendWriteCompositeRequest.

@Override
public void sendWriteCompositeRequest(LwM2mClient client, RpcWriteCompositeRequest rpcWriteCompositeRequest, DownlinkRequestCallback<WriteCompositeRequest, WriteCompositeResponse> callback, ContentFormat contentFormatComposite) {
    try {
        WriteCompositeRequest downlink = new WriteCompositeRequest(contentFormatComposite, rpcWriteCompositeRequest.getNodes());
        // TODO: replace config.getTimeout();
        sendWriteCompositeRequest(client, downlink, this.config.getTimeout(), callback);
    } catch (InvalidRequestException e) {
        callback.onValidationError(rpcWriteCompositeRequest.toString(), e.getMessage());
    } catch (Exception e) {
        callback.onError(toString(rpcWriteCompositeRequest), e);
    }
}
Also used : RpcWriteCompositeRequest(org.thingsboard.server.transport.lwm2m.server.rpc.composite.RpcWriteCompositeRequest) WriteCompositeRequest(org.eclipse.leshan.core.request.WriteCompositeRequest) InvalidRequestException(org.eclipse.leshan.core.request.exception.InvalidRequestException) ClientSleepingException(org.eclipse.leshan.core.request.exception.ClientSleepingException) TimeoutException(org.eclipse.leshan.core.request.exception.TimeoutException) InvalidRequestException(org.eclipse.leshan.core.request.exception.InvalidRequestException)

Aggregations

WriteCompositeRequest (org.eclipse.leshan.core.request.WriteCompositeRequest)1 ClientSleepingException (org.eclipse.leshan.core.request.exception.ClientSleepingException)1 InvalidRequestException (org.eclipse.leshan.core.request.exception.InvalidRequestException)1 TimeoutException (org.eclipse.leshan.core.request.exception.TimeoutException)1 RpcWriteCompositeRequest (org.thingsboard.server.transport.lwm2m.server.rpc.composite.RpcWriteCompositeRequest)1