SensESP 2.7.2
Universal Signal K sensor toolkit ESP32
Loading...
Searching...
No Matches
system_status_controller.h
Go to the documentation of this file.
1#ifndef _SYSTEM_STATUS_CONTROLLER_H_
2#define _SYSTEM_STATUS_CONTROLLER_H_
3
7
8namespace sensesp {
9
19
27class SystemStatusController : public ValueConsumer<WiFiState>,
28 public ValueConsumer<WSConnectionState>,
29 public ValueProducer<SystemStatus> {
30 public:
32
35 virtual void set_input(WiFiState new_value,
36 uint8_t input_channel = 0) override;
40 uint8_t input_channel = 0) override;
41
42 protected:
44 current_state_ = new_state;
45 this->emit(new_state);
46 }
47
48 private:
50};
51
52} // namespace sensesp
53
54#endif
Construct a new transform based on a single function.
Base class for a controller that can react to system status events.
void update_state(const SystemStatus new_state)
virtual void set_input(WiFiState new_value, uint8_t input_channel=0) override
A base class for piece of code (like a transform) that accepts data for input. ValueConsumers can acc...
A base class for any sensor or piece of code that outputs a value for consumption elsewhere.
void emit(SystemStatus new_value)
WSConnectionState
Definition ws_client.h:20