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

Minimal Button Handler. More...

#include <sensesp/system/minimal_button.h>

Inheritance diagram for sensesp::MinimalButtonHandler:
[legend]

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="")
 

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 Attributes

elapsedMillis time_since_press_event
 
- Protected Attributes inherited from sensesp::BaseButtonHandler
std::unique_ptr< AceButton > button_
 

Detailed Description

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 23 of file minimal_button.h.

Constructor & Destructor Documentation

◆ MinimalButtonHandler()

sensesp::MinimalButtonHandler::MinimalButtonHandler ( int pin,
String config_path = "" )
inline

Definition at line 25 of file minimal_button.h.

Member Function Documentation

◆ handle_button_press()

virtual void sensesp::MinimalButtonHandler::handle_button_press ( )
inlineprotectedvirtual

Handle a brief button press (less than one second).

Definition at line 59 of file minimal_button.h.

Here is the caller graph for this function:

◆ handle_long_press()

virtual void sensesp::MinimalButtonHandler::handle_long_press ( )
inlineprotectedvirtual

Handle a long button press (over 1 second).

Reimplemented in sensesp::ButtonHandler.

Definition at line 69 of file minimal_button.h.

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

◆ handle_very_long_press()

virtual void sensesp::MinimalButtonHandler::handle_very_long_press ( )
inlineprotectedvirtual

Handle a very long button press (over 5 seconds).

Definition at line 74 of file minimal_button.h.

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

◆ handleEvent()

virtual void sensesp::MinimalButtonHandler::handleEvent ( AceButton * button,
uint8_t event_type,
uint8_t button_state )
inlineoverridevirtual

Definition at line 28 of file minimal_button.h.

Here is the call graph for this function:

Member Data Documentation

◆ time_since_press_event

elapsedMillis sensesp::MinimalButtonHandler::time_since_press_event
protected

Definition at line 54 of file minimal_button.h.


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