SensESP 3.0.1
Universal Signal K sensor toolkit ESP32
|
Handle async command responses from remote systems. More...
#include <sensesp/system/async_response_handler.h>
Public Member Functions | |
AsyncResponseHandler () | |
AsyncResponseHandler (int timeout) | |
void | activate () |
Activate must be called when a command is sent to the remote system. | |
void | set (const bool &success) override |
const AsyncResponseStatus | get_status () const |
Public Member Functions inherited from sensesp::ValueConsumer< bool > | |
virtual void | set_input (const bool &new_value) |
void | connect_from (ValueProducer< bool > *producer) |
Public Member Functions inherited from sensesp::ValueProducer< AsyncResponseStatus > | |
ValueProducer () | |
ValueProducer (const AsyncResponseStatus &initial_value) | |
virtual const AsyncResponseStatus & | get () const |
std::enable_if< std::is_base_of< ValueConsumer< typenameVConsumer::input_type >, VConsumer >::value &&std::is_convertible< AsyncResponseStatus, typenameVConsumer::input_type >::value, std::shared_ptr< VConsumer > >::type | connect_to (std::shared_ptr< VConsumer > consumer) |
Connect a producer to a transform with a different input type. | |
std::enable_if< std::is_base_of< ValueConsumer< typenameVConsumer::input_type >, VConsumer >::value &&std::is_convertible< AsyncResponseStatus, typenameVConsumer::input_type >::value, VConsumer * >::type | connect_to (VConsumer *consumer) |
std::enable_if< std::is_base_of< ValueConsumer< typenameVConsumer::input_type >, VConsumer >::value &&std::is_convertible< AsyncResponseStatus, typenameVConsumer::input_type >::value, VConsumer * >::type | connect_to (VConsumer &consumer) |
void | emit (const AsyncResponseStatus &new_value) |
Public Member Functions inherited from sensesp::Observable | |
Observable () | |
Observable (Observable &&other) | |
Move constructor. | |
void | notify () |
void | attach (std::function< void()> observer) |
Protected Attributes | |
reactesp::DelayEvent * | timeout_event_ = nullptr |
AsyncResponseStatus | status_ = AsyncResponseStatus::kReady |
String | result_message_ |
int | timeout_ = 3000 |
elapsedMillis | elapsed_millis_ |
Protected Attributes inherited from sensesp::ValueProducer< AsyncResponseStatus > | |
AsyncResponseStatus | output_ |
Additional Inherited Members | |
Public Types inherited from sensesp::ValueConsumer< bool > | |
using | input_type |
Handle async command responses from remote systems.
This class is used to report responses to commands sent to a remote system. The class should consume a boolean value when a response is received. The boolean value indicates whether the command was successful or not. The response handler also emits the response status to its subscribers.
Definition at line 31 of file async_response_handler.h.
|
inline |
Definition at line 34 of file async_response_handler.h.
|
inline |
Definition at line 36 of file async_response_handler.h.
|
inline |
Activate must be called when a command is sent to the remote system.
value |
Definition at line 46 of file async_response_handler.h.
|
inline |
Definition at line 91 of file async_response_handler.h.
|
inlineoverridevirtual |
Used to set an input of this consumer. It is called automatically by a ValueProducer but can also be called manually.
new_value | the value of the input |
Reimplemented from sensesp::ValueConsumer< bool >.
Definition at line 67 of file async_response_handler.h.
|
protected |
Definition at line 98 of file async_response_handler.h.
|
protected |
Definition at line 96 of file async_response_handler.h.
|
protected |
Definition at line 95 of file async_response_handler.h.
|
protected |
Definition at line 97 of file async_response_handler.h.
|
protected |
Definition at line 94 of file async_response_handler.h.