SensESP 2.7.2
Universal Signal K sensor toolkit ESP32
Loading...
Searching...
No Matches
sensesp::SKPutRequest< T > Class Template Reference

Used to send requests to the server to change the value of the specified path to a specific value according to the specification at https://signalk.org/specification/1.5.0/doc/put.html. More...

#include <sensesp/signalk/signalk_put_request.h>

Inheritance diagram for sensesp::SKPutRequest< T >:
[legend]

Public Member Functions

 SKPutRequest (String sk_path, String config_path="", bool ignore_duplicates=true, uint32_t timeout=5000)
 
virtual void set_input (T new_value, uint8_t input_channel=0) override
 
virtual void set_put_value (JsonObject &put_data) override
 
- Public Member Functions inherited from sensesp::SKPutRequestBase
 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 ()
 
- Public Member Functions inherited from sensesp::ValueConsumer< T >
void connect_from (ValueProducer< T > *producer, uint8_t input_channel=0)
 

Protected Attributes

value
 
bool ignore_duplicates
 
- Protected Attributes inherited from sensesp::SKPutRequestBase
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_
 
- Protected Member Functions inherited from sensesp::SKPutRequestBase
void send_put_request ()
 
virtual void on_response (DynamicJsonDocument &response)
 
- Protected Member Functions inherited from sensesp::Configurable
virtual void load_configuration ()
 
- 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

template<typename T>
class sensesp::SKPutRequest< T >

Used to send requests to the server to change the value of the specified path to a specific value according to the specification at https://signalk.org/specification/1.5.0/doc/put.html.

Definition at line 134 of file signalk_put_request.h.

Constructor & Destructor Documentation

◆ SKPutRequest()

template<typename T >
sensesp::SKPutRequest< T >::SKPutRequest ( String  sk_path,
String  config_path = "",
bool  ignore_duplicates = true,
uint32_t  timeout = 5000 
)
inline

The constructor

Parameters
sk_pathThe SignalK path the put request will be made on
config_pathThe configuration path to save the configuration
ignore_duplicatesTRUE if incoming values that have not changed since the last one should not generated a PUT request
timeoutThe number of milliseconds to wait for a COMPLETED or FAILED response to be received from the server

Definition at line 145 of file signalk_put_request.h.

Member Function Documentation

◆ set_input()

template<typename T >
virtual void sensesp::SKPutRequest< T >::set_input ( new_value,
uint8_t  input_channel = 0 
)
inlineoverridevirtual

Used to set an input of this consumer. It is usually called automatically by a ValueProducer.

Parameters
new_valuethe value of the input
input_channelConsumers can have one or more inputs feeding them. This parameter allows you to specify which input number the producer is connecting to. For single input consumers, leave the index at zero.

Reimplemented from sensesp::ValueConsumer< T >.

Definition at line 150 of file signalk_put_request.h.

Here is the call graph for this function:

◆ set_put_value()

template<typename T >
virtual void sensesp::SKPutRequest< T >::set_put_value ( JsonObject put_data)
inlineoverridevirtual

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

Implements sensesp::SKPutRequestBase.

Definition at line 162 of file signalk_put_request.h.

Member Data Documentation

◆ ignore_duplicates

template<typename T >
bool sensesp::SKPutRequest< T >::ignore_duplicates
protected

Definition at line 168 of file signalk_put_request.h.

◆ value

template<typename T >
T sensesp::SKPutRequest< T >::value
protected

Definition at line 167 of file signalk_put_request.h.


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