SensESP 2.7.2
Universal Signal K sensor toolkit ESP32
|
Minimal Button Handler. More...
#include <sensesp/system/minimal_button.h>
Public Member Functions | |
MinimalButtonHandler (int pin, String config_path="") | |
virtual void | handleEvent (AceButton *button, uint8_t event_type, uint8_t button_state) override |
Public Member Functions inherited from sensesp::BaseButtonHandler | |
BaseButtonHandler (int pin, String config_path="") | |
virtual void | start () override |
Public Member Functions inherited from sensesp::Configurable | |
Configurable (String config_path="", String description="", int sort_order=1000) | |
virtual void | get_configuration (JsonObject &configObject) |
virtual bool | set_configuration (const JsonObject &config) |
virtual String | get_config_schema () |
String | get_description () |
void | set_description (String description) |
Set the description of the Configurable. | |
int | get_sort_order () |
void | set_sort_order (int sort_order) |
virtual void | save_configuration () |
Public Member Functions inherited from sensesp::Startable | |
Startable (int priority=0) | |
const int | get_start_priority () |
void | set_start_priority (int priority) |
Protected Member Functions | |
virtual void | handle_button_press () |
Handle a brief button press (less than one second). | |
virtual void | handle_long_press () |
Handle a long button press (over 1 second). | |
virtual void | handle_very_long_press () |
Handle a very long button press (over 5 seconds). | |
Protected Member Functions inherited from sensesp::Configurable | |
virtual void | load_configuration () |
Protected Attributes | |
elapsedMillis | time_since_press_event |
Protected Attributes inherited from sensesp::BaseButtonHandler | |
AceButton * | button_ |
Protected Attributes inherited from sensesp::Configurable | |
String | description_ = "" |
int | sort_order_ = 1000 |
Additional Inherited Members | |
Static Public Member Functions inherited from sensesp::Startable | |
static void | start_all () |
Public Attributes inherited from sensesp::Configurable | |
const String | config_path_ |
Minimal Button Handler.
This is a minimal button handler that implements restart on short press and factory reset on a very long press.
This class may be extended to implement more complex button handlers.
Definition at line 24 of file minimal_button.h.
Definition at line 26 of file minimal_button.h.
Handle a brief button press (less than one second).
Definition at line 59 of file minimal_button.h.
Handle a long button press (over 1 second).
Reimplemented in sensesp::ButtonHandler.
Definition at line 68 of file minimal_button.h.
Handle a very long button press (over 5 seconds).
Definition at line 75 of file minimal_button.h.
|
protected |
Definition at line 54 of file minimal_button.h.