SensESP 3.0.1
Universal Signal K sensor toolkit ESP32
|
A base class for all objects that are capable of sending "requests" to the SignalK server (and optionally receiving the responses) according to the specification located at https://signalk.org/specification/1.5.0/doc/request_response.html. More...
#include <sensesp/signalk/signalk_put_request.h>
Classes | |
class | PendingRequest |
Static Public Member Functions | |
static String | send_request (JsonDocument &request, std::function< void(JsonDocument &)> callback, uint32_t timeout=5000) |
static void | handle_response (JsonDocument &response) |
Static Protected Member Functions | |
static void | remove_request (String request_id) |
static PendingRequest * | get_request (String request_id) |
Static Protected Attributes | |
static std::map< String, PendingRequest * > | request_map_ |
A base class for all objects that are capable of sending "requests" to the SignalK server (and optionally receiving the responses) according to the specification located at https://signalk.org/specification/1.5.0/doc/request_response.html.
Definition at line 19 of file signalk_put_request.h.
|
staticprotected |
Returns the pending request object associated with request_id, or nullptr if no such id is found.
Definition at line 49 of file signalk_put_request.cpp.
|
static |
Is called by the web socket code to handle any incoming request responses that is receives.
Definition at line 57 of file signalk_put_request.cpp.
|
staticprotected |
Removes the specified request_id from the request_map, cleaning up outstanding events if necessary
Definition at line 75 of file signalk_put_request.cpp.
|
static |
Sends the specified request to the server via the connected websocket.
request | The json document to send for the request. This document should follow the formats specified in the SignalK Request/Response specification with the exception that it should not contain a "requestId" (as this method will add it). |
callback | The callback method that processes any and all responses from the server that correspond to the request. |
timeout | The number of milliseconds to wait for a COMPLETED or FAILED response to be received from the server |
Definition at line 10 of file signalk_put_request.cpp.
|
staticprotected |
A map to hold all of the requests we are expecting future responses from...
Definition at line 55 of file signalk_put_request.h.