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

Base class for a controller that can react to system status events. More...

#include <sensesp/controllers/system_status_controller.h>

Inheritance diagram for sensesp::SystemStatusController:
[legend]

Public Member Functions

 SystemStatusController ()
 
ValueConsumer< WiFiState > & get_wifi_state_consumer ()
 
ValueConsumer< SKWSConnectionState > & get_ws_connection_state_consumer ()
 
- Public Member Functions inherited from sensesp::ValueProducer< SystemStatus >
 ValueProducer ()
 
 ValueProducer (const SystemStatus &initial_value)
 
virtual const SystemStatusget () const
 
std::enable_if< std::is_base_of< ValueConsumer< typenameVConsumer::input_type >, VConsumer >::value &&std::is_convertible< SystemStatus, 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< SystemStatus, 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< SystemStatus, typenameVConsumer::input_type >::value, VConsumer * >::type connect_to (VConsumer &consumer)
 
void emit (const SystemStatus &new_value)
 
- Public Member Functions inherited from sensesp::Observable
 Observable ()
 
 Observable (Observable &&other)
 Move constructor.
 
void notify ()
 
void attach (std::function< void()> observer)
 

Protected Member Functions

void set_wifi_state (const WiFiState &new_value)
 
void set_sk_ws_connection_state (const SKWSConnectionState &new_value)
 
void update_state (const SystemStatus new_state)
 

Protected Attributes

LambdaConsumer< WiFiStatewifi_state_consumer_
 
LambdaConsumer< SKWSConnectionStatews_connection_state_consumer_
 
- Protected Attributes inherited from sensesp::ValueProducer< SystemStatus >
SystemStatus output_
 

Detailed Description

Base class for a controller that can react to system status events.

Classes inheriting from SystemStatusController should override the set_wifi_* and set_ws_* methods to take the relevant action when such an event occurs.

Definition at line 28 of file system_status_controller.h.

Constructor & Destructor Documentation

◆ SystemStatusController()

sensesp::SystemStatusController::SystemStatusController ( )
inline

Definition at line 30 of file system_status_controller.h.

Member Function Documentation

◆ get_wifi_state_consumer()

ValueConsumer< WiFiState > & sensesp::SystemStatusController::get_wifi_state_consumer ( )
inline

Definition at line 32 of file system_status_controller.h.

◆ get_ws_connection_state_consumer()

ValueConsumer< SKWSConnectionState > & sensesp::SystemStatusController::get_ws_connection_state_consumer ( )
inline

Definition at line 36 of file system_status_controller.h.

◆ set_sk_ws_connection_state()

void sensesp::SystemStatusController::set_sk_ws_connection_state ( const SKWSConnectionState & new_value)
inlineprotected

Definition at line 59 of file system_status_controller.h.

Here is the call graph for this function:

◆ set_wifi_state()

void sensesp::SystemStatusController::set_wifi_state ( const WiFiState & new_value)
inlineprotected

Definition at line 41 of file system_status_controller.h.

Here is the call graph for this function:

◆ update_state()

void sensesp::SystemStatusController::update_state ( const SystemStatus new_state)
inlineprotected

Definition at line 88 of file system_status_controller.h.

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

Member Data Documentation

◆ wifi_state_consumer_

LambdaConsumer<WiFiState> sensesp::SystemStatusController::wifi_state_consumer_
protected
Initial value:
{
[this](const WiFiState& new_value) { this->set_wifi_state(new_value); }}
void set_wifi_state(const WiFiState &new_value)

Definition at line 81 of file system_status_controller.h.

◆ ws_connection_state_consumer_

LambdaConsumer<SKWSConnectionState> sensesp::SystemStatusController::ws_connection_state_consumer_
protected
Initial value:
{
[this](const SKWSConnectionState& new_value) {
this->set_sk_ws_connection_state(new_value);
}}
void set_sk_ws_connection_state(const SKWSConnectionState &new_value)

Definition at line 83 of file system_status_controller.h.


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