Search in sources :

Example 1 with GetAttributesSyncSessionCallback

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

the class CoapTransportResource method handleGetAttributesRequest.

private void handleGetAttributesRequest(TbCoapClientState clientState, CoapExchange exchange, Request request) throws AdaptorException {
    TransportProtos.SessionInfoProto sessionInfo = clients.getNewSyncSession(clientState);
    UUID sessionId = toSessionId(sessionInfo);
    transportService.registerSyncSession(sessionInfo, new GetAttributesSyncSessionCallback(clientState, exchange, request), timeout);
    transportService.process(sessionInfo, clientState.getAdaptor().convertToGetAttributes(sessionId, request), new CoapNoOpCallback(exchange));
}
Also used : CoapNoOpCallback(org.thingsboard.server.transport.coap.callback.CoapNoOpCallback) GetAttributesSyncSessionCallback(org.thingsboard.server.transport.coap.callback.GetAttributesSyncSessionCallback) 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 GetAttributesSyncSessionCallback (org.thingsboard.server.transport.coap.callback.GetAttributesSyncSessionCallback)1