SensESP 3.0.1
Universal Signal K sensor toolkit ESP32
Loading...
Searching...
No Matches
sensesp::SKPutRequestBase Class Referenceabstract

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>

Inheritance diagram for sensesp::SKPutRequestBase:
[legend]

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 PendingRequestget_request (String request_id)
 
- Static Protected Attributes inherited from sensesp::SKRequest
static std::map< String, PendingRequest * > request_map_
 

Detailed Description

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.

See also
SKPutRequest See https://signalk.org/specification/1.5.0/doc/put.html

Definition at line 74 of file signalk_put_request.h.

Constructor & Destructor Documentation

◆ SKPutRequestBase()

sensesp::SKPutRequestBase::SKPutRequestBase ( const String & sk_path,
const String & config_path = "",
uint32_t timeout = 5000 )

The constructor

Parameters
sk_pathThe SignalK path the put request will be made on
config_pathThe configuration path to save the configuration
timeoutThe 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.

Here is the call graph for this function:

Member Function Documentation

◆ from_json()

bool sensesp::SKPutRequestBase::from_json ( const JsonObject & root)
overridevirtual

Deserializes the current object data from a JsonObject.

Reimplemented from sensesp::Serializable.

Definition at line 127 of file signalk_put_request.cpp.

◆ get_sk_path()

String sensesp::SKPutRequestBase::get_sk_path ( )
inline

Returns the Signal K path this object makes requests to

Definition at line 94 of file signalk_put_request.h.

◆ on_response()

void sensesp::SKPutRequestBase::on_response ( JsonDocument & response)
protectedvirtual

Called whenever a response to a request has been received from the server

Definition at line 115 of file signalk_put_request.cpp.

Here is the caller graph for this function:

◆ request_pending()

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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ send_put_request()

void sensesp::SKPutRequestBase::send_put_request ( )
protected

Sends the put request to the server

Definition at line 100 of file signalk_put_request.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_put_value()

virtual void sensesp::SKPutRequestBase::set_put_value ( JsonObject & put_data)
protectedpure virtual

Sets the "value" field of the put request with the appropriate value.

Implemented in sensesp::SKPutRequest< T >.

Here is the caller graph for this function:

◆ to_json()

bool sensesp::SKPutRequestBase::to_json ( JsonObject & root)
overridevirtual

Serializes the current object data into a JsonObject.

Reimplemented from sensesp::Serializable.

Definition at line 122 of file signalk_put_request.cpp.

Member Data Documentation

◆ pending_request_id_

String sensesp::SKPutRequestBase::pending_request_id_ {}
protected

Definition at line 123 of file signalk_put_request.h.

◆ sk_path

String sensesp::SKPutRequestBase::sk_path {}
protected

Definition at line 121 of file signalk_put_request.h.

◆ timeout

uint32_t sensesp::SKPutRequestBase::timeout {}
protected

Definition at line 122 of file signalk_put_request.h.


The documentation for this class was generated from the following files: