|
SensESP 3.4.1-alpha
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 () |
| int | attach (std::function< void()> observer) |
| Attach an observer callback. | |
| void | detach (int id) |
| Remove a previously attached observer by its ID. | |
Protected Attributes | |
| reactesp::DelayEvent * | timeout_event_ = nullptr |
| AsyncResponseStatus | status_ = AsyncResponseStatus::kReady |
| int | timeout_ = 3000 |
Protected Attributes inherited from sensesp::ValueProducer< AsyncResponseStatus > | |
| AsyncResponseStatus | output_ |
Additional Inherited Members | |
Public Types inherited from sensesp::ValueConsumer< bool > | |
| using | input_type = bool |
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 30 of file async_response_handler.h.
|
inline |
Definition at line 33 of file async_response_handler.h.
|
inline |
Definition at line 35 of file async_response_handler.h.
|
inline |
Activate must be called when a command is sent to the remote system.
| value |
Definition at line 45 of file async_response_handler.h.
|
inline |
Definition at line 89 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 65 of file async_response_handler.h.
|
protected |
Definition at line 93 of file async_response_handler.h.
|
protected |
Definition at line 94 of file async_response_handler.h.
|
protected |
Definition at line 92 of file async_response_handler.h.