SensESP 3.0.1
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 (const String &sk_path, const String &config_path="", uint32_t timeout=5000) | |
virtual bool | to_json (JsonObject &root) override |
virtual bool | from_json (const JsonObject &config) override |
String | get_sk_path () |
bool | request_pending () |
Public Member Functions inherited from sensesp::FileSystemSaveable | |
FileSystemSaveable (const String &config_path) | |
virtual bool | load () override |
Load and populate the object from a persistent storage. | |
virtual bool | save () override |
Save the object to a persistent storage. | |
virtual bool | clear () override |
Delete the data from a persistent storage. | |
bool | find_config_file (const String &config_path, String &filename) |
Public Member Functions inherited from sensesp::Saveable | |
Saveable (const String &config_path) | |
virtual bool | refresh () |
Refresh the object. This may or may not access the persistent storage but is not expected to overwrite the object's state. | |
const String & | get_config_path () const |
Public Member Functions inherited from sensesp::Serializable |
Protected Member Functions | |
void | send_put_request () |
virtual void | set_put_value (JsonObject &put_data)=0 |
virtual void | on_response (JsonDocument &response) |
Protected Attributes | |
String | sk_path {} |
uint32_t | timeout {} |
String | pending_request_id_ {} |
Protected Attributes inherited from sensesp::Saveable | |
const String | config_path_ |
Additional Inherited Members | |
Static Public Member Functions inherited from sensesp::SKRequest | |
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 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 74 of file signalk_put_request.h.
sensesp::SKPutRequestBase::SKPutRequestBase | ( | const String & | sk_path, |
const 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 |
Deserializes the current object data from a JsonObject.
Reimplemented from sensesp::Serializable.
Definition at line 127 of file signalk_put_request.cpp.
|
inline |
Returns the Signal K path this object makes requests to
Definition at line 94 of file signalk_put_request.h.
|
protectedvirtual |
Called whenever a response to a request has been received from the server
Definition at line 115 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 111 of file signalk_put_request.cpp.
|
protected |
Sends the put request to the server
Definition at line 100 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 >.
|
overridevirtual |
Serializes the current object data into a JsonObject.
Reimplemented from sensesp::Serializable.
Definition at line 122 of file signalk_put_request.cpp.
|
protected |
Definition at line 123 of file signalk_put_request.h.
|
protected |
Definition at line 121 of file signalk_put_request.h.
|
protected |
Definition at line 122 of file signalk_put_request.h.