LSH-Core
A robust C++ framework for Arduino-based home automation nodes
Loading...
Searching...
No Matches
NetworkClicks Namespace Reference

"static class" Used to store and check network clicks More...

Functions

void request (uint8_t clickableIndex, constants::ClickType clickType)
 Initiates a network click action.
 
auto confirm (uint8_t clickableIndex, constants::ClickType clickType) -> bool
 Confirms a pending network click action after receiving an ACK.
 
void storeNetworkClickTime (uint8_t clickableIndex, constants::ClickType clickType)
 Store click time for a network attached clickable.
 
auto thereAreActiveNetworkCLicks () -> bool
 Get if there are active stored network clicks.
 
void eraseNetworkClick (uint8_t clickableIndex, constants::ClickType clickType)
 Erase a stored network click.
 
auto isNetworkClickExpired (uint8_t clickableIndex, constants::ClickType clickType) -> bool
 Checks if a pending network click has expired.
 
auto checkNetworkClickTimer (uint8_t clickableIndex, constants::ClickType clickType, bool failover) -> bool
 Checks a specific pending network click for expiration or forced failover.
 
auto checkAllNetworkClicksTimers (bool failover) -> bool
 Timeout checks for all network clicked clickables.
 

Variables

etl::map< uint8_t, uint32_t, CONFIG_MAX_CLICKABLES > longClickedNetworkClickables {}
 Map of long clicked network clickable (<Clickable index, stored time>)
 
etl::map< uint8_t, uint32_t, CONFIG_MAX_CLICKABLES > superLongClickedNetworkClickables {}
 Map of super long clicked network clickable (<Clickable index, stored time>)
 

Detailed Description

"static class" Used to store and check network clicks

Function Documentation

◆ checkAllNetworkClicksTimers()

auto NetworkClicks::checkAllNetworkClicksTimers ( bool  failover) -> bool

Timeout checks for all network clicked clickables.

If the time is over it performs local action and resets the timer

Parameters
failoverto perform local action regardless the state of the timer.
Returns
true if any timer is expired and at least one local fallback click has been performed.
false otherwise.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ checkNetworkClickTimer()

auto NetworkClicks::checkNetworkClickTimer ( uint8_t  clickableIndex,
constants::ClickType  clickType,
bool  failover 
) -> bool

Checks a specific pending network click for expiration or forced failover.

If the timer has expired, or if failover is true, this function triggers the configured fallback action (if any) and removes the click from the pending map.

Parameters
clickableIndexThe index of the clickable to check.
clickTypeThe type of the pending click.
failoverIf true, force the fallback action regardless of the timer's state.
Returns
true if a fallback action was performed, false otherwise.
Here is the call graph for this function:

◆ confirm()

auto NetworkClicks::confirm ( uint8_t  clickableIndex,
constants::ClickType  clickType 
) -> bool

Confirms a pending network click action after receiving an ACK.

Sends the final confirmation message and removes the click from the pending list.

Parameters
clickableIndexThe index of the clickable to confirm.
clickTypeThe type of click to confirm.
Returns
true if there are still other active network clicks pending, false otherwise.
Here is the call graph for this function:

◆ eraseNetworkClick()

void NetworkClicks::eraseNetworkClick ( uint8_t  clickableIndex,
constants::ClickType  clickType 
)

Erase a stored network click.

Parameters
clickableIndexindex of the clickable.
clickTypetype of the click.
Here is the caller graph for this function:

◆ isNetworkClickExpired()

auto NetworkClicks::isNetworkClickExpired ( uint8_t  clickableIndex,
constants::ClickType  clickType 
) -> bool

Checks if a pending network click has expired.

If the click has expired, it is removed from the pending list as a side effect.

Parameters
clickableIndexThe index of the clickable to check.
clickTypeThe type of the pending click (long or super long).
Returns
true if the pending network click has expired, false otherwise.
Here is the call graph for this function:

◆ request()

void NetworkClicks::request ( uint8_t  clickableIndex,
constants::ClickType  clickType 
)

Initiates a network click action.

Sends the initial network click request and starts the fallback timer. This function does not return a value; the caller is responsible for managing any necessary state changes.

Parameters
clickableIndexThe index of the clickable that was pressed.
clickTypeThe type of click (LONG or SUPER_LONG).
Here is the call graph for this function:
Here is the caller graph for this function:

◆ storeNetworkClickTime()

void NetworkClicks::storeNetworkClickTime ( uint8_t  clickableIndex,
constants::ClickType  clickType 
)

Store click time for a network attached clickable.

Parameters
clickableIndexthe index of the clickable.
clickTypethe type of the click (long or super long).
Here is the call graph for this function:
Here is the caller graph for this function:

◆ thereAreActiveNetworkCLicks()

auto NetworkClicks::thereAreActiveNetworkCLicks ( ) -> bool

Get if there are active stored network clicks.

Returns
true if active stored network clicks are found.
false there are no stored network click.
Here is the caller graph for this function: