SensESP 2.7.2
Universal Signal K sensor toolkit ESP32
|
A base class for all template variations of the PUT request class SKPutRequest. This base class keeps the compiler from generating reduntant object code for common functionality of each template version. More...
#include <sensesp/signalk/signalk_put_request.h>
Public Member Functions | |
SKPutRequestBase (String sk_path, String config_path="", uint32_t timeout=5000) | |
virtual void | get_configuration (JsonObject &doc) override |
virtual bool | set_configuration (const JsonObject &config) override |
virtual String | get_config_schema () override |
String | get_sk_path () |
bool | request_pending () |
Public Member Functions inherited from sensesp::Configurable | |
Configurable (String config_path="", String description="", int sort_order=1000) | |
String | get_description () |
void | set_description (String description) |
Set the description of the Configurable. | |
int | get_sort_order () |
void | set_sort_order (int sort_order) |
virtual void | save_configuration () |
Protected Member Functions | |
void | send_put_request () |
virtual void | set_put_value (JsonObject &put_data)=0 |
virtual void | on_response (DynamicJsonDocument &response) |
Protected Member Functions inherited from sensesp::Configurable | |
virtual void | load_configuration () |
Protected Attributes | |
String | sk_path |
uint32_t | timeout |
String | pending_request_id_ |
Protected Attributes inherited from sensesp::Configurable | |
String | description_ = "" |
int | sort_order_ = 1000 |
Additional Inherited Members | |
Static Public Member Functions inherited from sensesp::SKRequest | |
static String | send_request (DynamicJsonDocument &request, std::function< void(DynamicJsonDocument &)> callback, uint32_t timeout=5000) |
static void | handle_response (DynamicJsonDocument &response) |
Public Attributes inherited from sensesp::Configurable | |
const String | config_path_ |
Static Protected Member Functions inherited from sensesp::SKRequest | |
static void | remove_request (String request_id) |
static PendingRequest * | get_request (String request_id) |
Static Protected Attributes inherited from sensesp::SKRequest | |
static std::map< String, PendingRequest * > | request_map |
A base class for all template variations of the PUT request class SKPutRequest. This base class keeps the compiler from generating reduntant object code for common functionality of each template version.
Definition at line 75 of file signalk_put_request.h.
sensesp::SKPutRequestBase::SKPutRequestBase | ( | String | sk_path, |
String | config_path = "" , |
||
uint32_t | timeout = 5000 |
||
) |
The constructor
sk_path | The SignalK path the put request will be made on |
config_path | The configuration path to save the configuration |
timeout | The number of milliseconds to wait for a COMPLETED or FAILED response to be received from the server |
Definition at line 94 of file signalk_put_request.cpp.
|
overridevirtual |
Returns a configuration schema that specifies the key/value pairs that can be expected when calling get_configuration(), or are expected by set_configuration(). The schema will be in JSON Schema format
Reimplemented from sensesp::Configurable.
Definition at line 134 of file signalk_put_request.cpp.
|
overridevirtual |
Returns the current configuration data as a JsonObject. In general, the current state of local member variables are saved to a new object created with JsonDocument::as<JsonObject>() and returned.
Reimplemented from sensesp::Configurable.
Definition at line 123 of file signalk_put_request.cpp.
|
inline |
Returns the Signal K path this object makes requests to
Definition at line 95 of file signalk_put_request.h.
|
protectedvirtual |
Called whenever a response to a request has been received from the server
Definition at line 116 of file signalk_put_request.cpp.
bool sensesp::SKPutRequestBase::request_pending | ( | ) |
Returns TRUE if there is currently a PUT request pending (i.e. this class has send a request, and it has not yet received a reply or timeout)
Definition at line 112 of file signalk_put_request.cpp.
|
protected |
Sends the put request to the server
Definition at line 100 of file signalk_put_request.cpp.
|
overridevirtual |
Sets the current state of local member variables using the data stored in config.
Reimplemented from sensesp::Configurable.
Definition at line 136 of file signalk_put_request.cpp.
|
protectedpure virtual |
Sets the "value" field of the put request with the appropriate value.
Implemented in sensesp::SKPutRequest< T >.
|
protected |
Definition at line 124 of file signalk_put_request.h.
|
protected |
Definition at line 122 of file signalk_put_request.h.
|
protected |
Definition at line 123 of file signalk_put_request.h.