|
LSH-Core
A robust C++ framework for Arduino-based home automation nodes
|
Forward declaration. More...
Functions | |
| void | addClickable (Clickable *const clickable) |
| Adds a clickable to the system. | |
| auto | getClickable (uint8_t clickableId) -> Clickable * |
| Get a single clickable. | |
| auto | getIndex (uint8_t clickableId) -> uint8_t |
| Get a single clickable index (in device vector of clickable). | |
| auto | clickableExists (uint8_t clickableId) -> bool |
| Get if the clickable actually exists. | |
| auto | click (const Clickable *const clickable, constants::ClickType clickType) -> bool |
| Perform a click. | |
| auto | click (uint8_t clickableIndex, constants::ClickType clickType) -> bool |
| Perform a click action. | |
| void | finalizeSetup () |
| Resize vectors of all clickables to the actual needed size. | |
Variables | |
| uint8_t | totalClickables = 0U |
| Device real total Clickables. | |
| etl::array< Clickable *, CONFIG_MAX_CLICKABLES > | clickables {} |
| Device clickables. | |
| etl::map< uint8_t, uint8_t, CONFIG_MAX_CLICKABLES > | clickablesMap {} |
| Device clickables map (UUID -> clickables index) | |
Forward declaration.
Globally stores all clickables (like buttons) and to operates over them.
| void Clickables::addClickable | ( | Clickable *const | clickable | ) |
Adds a clickable to the system.
The clickable is stored in the main array and its ID is mapped to its index for fast lookups. If the maximum number of clickables is exceeded, the device will reset to prevent undefined behavior.
| clickable | A pointer to the Clickable object to add. |

| auto Clickables::click | ( | const Clickable *const | clickable, |
| constants::ClickType | clickType | ||
| ) | -> bool |
Perform a click.
Method for all types of clicks, since not all click can be done within clickable class.
| clickable | the clickable to click. |
| clickType | the click type to perform. |


| auto Clickables::click | ( | uint8_t | clickableIndex, |
| constants::ClickType | clickType | ||
| ) | -> bool |
Perform a click action.
This helper function centralizes all click-related logic...
| clickableIndex | The index of the clickable to click. |
| clickType | The click type to perform. |

| auto Clickables::clickableExists | ( | uint8_t | clickableId | ) | -> bool |
Get if the clickable actually exists.
| clickableId | Unique ID of the clickable. |
| auto Clickables::getClickable | ( | uint8_t | clickableId | ) | -> Clickable * |
Get a single clickable.
| clickableId | clickable UUID. |
| auto Clickables::getIndex | ( | uint8_t | clickableId | ) | -> uint8_t |
Get a single clickable index (in device vector of clickable).
| clickableId | clickable UUID. |
| etl::map< uint8_t, uint8_t, CONFIG_MAX_CLICKABLES > Clickables::clickablesMap {} |
Device clickables map (UUID -> clickables index)
Device clickables map (UUID (numeric)-> clickables index)