SensESP 2.7.2
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 (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 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 75 of file signalk_put_request.h.

Constructor & Destructor Documentation

◆ SKPutRequestBase()

sensesp::SKPutRequestBase::SKPutRequestBase ( String  sk_path,
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

◆ get_config_schema()

String sensesp::SKPutRequestBase::get_config_schema ( )
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

See also
https://json-schema.org

Reimplemented from sensesp::Configurable.

Definition at line 134 of file signalk_put_request.cpp.

◆ get_configuration()

void sensesp::SKPutRequestBase::get_configuration ( JsonObject configObject)
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.

◆ get_sk_path()

String sensesp::SKPutRequestBase::get_sk_path ( )
inline

Returns the Signal K path this object makes requests to

Definition at line 95 of file signalk_put_request.h.

◆ on_response()

void sensesp::SKPutRequestBase::on_response ( DynamicJsonDocument response)
protectedvirtual

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

Definition at line 116 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 112 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_configuration()

bool sensesp::SKPutRequestBase::set_configuration ( const JsonObject config)
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.

◆ 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:

Member Data Documentation

◆ pending_request_id_

String sensesp::SKPutRequestBase::pending_request_id_
protected

Definition at line 124 of file signalk_put_request.h.

◆ sk_path

String sensesp::SKPutRequestBase::sk_path
protected

Definition at line 122 of file signalk_put_request.h.

◆ timeout

uint32_t sensesp::SKPutRequestBase::timeout
protected

Definition at line 123 of file signalk_put_request.h.


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