Search in sources :

Example 1 with ToServerRpcSyncSessionCallback

use of org.thingsboard.server.transport.coap.callback.ToServerRpcSyncSessionCallback in project thingsboard by thingsboard.

the class CoapTransportResource method handleToServerRpcRequest.

private void handleToServerRpcRequest(TbCoapClientState clientState, CoapExchange exchange, Request request) throws AdaptorException {
    TransportProtos.SessionInfoProto sessionInfo = clients.getNewSyncSession(clientState);
    UUID sessionId = toSessionId(sessionInfo);
    transportService.registerSyncSession(sessionInfo, new ToServerRpcSyncSessionCallback(clientState, exchange, request), timeout);
    transportService.process(sessionInfo, clientState.getAdaptor().convertToServerRpcRequest(sessionId, request), new CoapNoOpCallback(exchange));
}
Also used : ToServerRpcSyncSessionCallback(org.thingsboard.server.transport.coap.callback.ToServerRpcSyncSessionCallback) CoapNoOpCallback(org.thingsboard.server.transport.coap.callback.CoapNoOpCallback) TransportProtos(org.thingsboard.server.gen.transport.TransportProtos) UUID(java.util.UUID)

Aggregations

UUID (java.util.UUID)1 TransportProtos (org.thingsboard.server.gen.transport.TransportProtos)1 CoapNoOpCallback (org.thingsboard.server.transport.coap.callback.CoapNoOpCallback)1 ToServerRpcSyncSessionCallback (org.thingsboard.server.transport.coap.callback.ToServerRpcSyncSessionCallback)1