SensESP 3.0.1
Universal Signal K sensor toolkit ESP32
Loading...
Searching...
No Matches
system_status_led.h
Go to the documentation of this file.
1#ifndef SENSESP_SRC_SENSESP_SYSTEM_SYSTEM_STATUS_LED_H_
2#define SENSESP_SRC_SENSESP_SYSTEM_SYSTEM_STATUS_LED_H_
3
4#include <memory>
5
6#include "lambda_consumer.h"
7#include "led_blinker.h"
9
10namespace sensesp {
11
18 protected:
19 std::unique_ptr<PatternBlinker> blinker_;
20
21 virtual void set_wifi_no_ap();
22 virtual void set_wifi_disconnected();
23 virtual void set_wifimanager_activated();
24
25 virtual void set_ws_disconnected();
26 virtual void set_ws_authorizing();
27 virtual void set_ws_connecting();
28 virtual void set_ws_connected();
29
31 [this](SystemStatus status) {
32 switch (status) {
34 this->set_wifi_no_ap();
35 break;
38 break;
41 break;
43 this->set_ws_disconnected();
44 break;
46 this->set_ws_connecting();
47 break;
49 this->set_ws_authorizing();
50 break;
52 this->set_ws_connected();
53 break;
54 }
55 }};
56
59
60 public:
61 SystemStatusLed(int pin);
62
69};
70
71} // namespace sensesp
72
73#endif
Provides an easy way of calling a function based on the output of any ValueProducer.
Consumes the networking and websocket states and delta counts and updates the device LED accordingly....
LambdaConsumer< int > delta_tx_count_consumer_
std::unique_ptr< PatternBlinker > blinker_
ValueConsumer< int > & get_delta_tx_count_consumer()
virtual void set_wifimanager_activated()
LambdaConsumer< SystemStatus > system_status_consumer_
ValueConsumer< SystemStatus > & get_system_status_consumer()
A base class for piece of code (like a transform) that accepts data for input. ValueConsumers can acc...