LSH-Core
Deterministic firmware core for Controllino-based Labo Smart Home nodes
 
Loading...
Searching...
No Matches
network_clicks.hpp
Go to the documentation of this file.
1
21#ifndef LSH_CORE_CORE_NETWORK_CLICKS_HPP
22#define LSH_CORE_CORE_NETWORK_CLICKS_HPP
23
24#include <stdint.h>
25
41namespace NetworkClicks
42{
43enum class RequestResult : uint8_t
44{
45 Accepted,
48};
49
50// Network clicks
51[[nodiscard]] auto request(uint8_t clickableIndex, constants::ClickType clickType)
52 -> RequestResult; // Initiates a network click action and reports whether the transaction was accepted, already pending, or rejected.
53[[nodiscard]] auto confirm(uint8_t clickableIndex, constants::ClickType clickType)
54 -> bool; // Confirms a pending network click action after receiving an ACK
55[[nodiscard]] auto matchesCorrelationId(uint8_t clickableIndex, constants::ClickType clickType, uint8_t correlationId)
56 -> bool; // Returns true if the active click matches the given correlation ID.
57[[nodiscard]] auto thereAreActiveNetworkClicks() -> bool; // Returns if there are active stored network clicks
58void eraseNetworkClick(uint8_t clickableIndex, constants::ClickType clickType); // Erase a stored network click
59[[nodiscard]] auto isNetworkClickExpired(uint8_t clickableIndex, constants::ClickType clickType)
60 -> bool; // Returns true if the pending network click has expired or is no longer active.
61[[nodiscard]] auto checkNetworkClickTimer(uint8_t clickableIndex, constants::ClickType clickType, bool failover)
62 -> bool; // Checks one pending network click and runs local fallback when it expires or failover is forced.
63[[nodiscard]] auto checkAllNetworkClicksTimers(bool failover)
64 -> bool; // Checks all pending network clicks and runs local fallbacks for expired or forced entries.
65} // namespace NetworkClicks
66
67#endif // LSH_CORE_CORE_NETWORK_CLICKS_HPP
Defines enums for various click types and fallback behaviors.
Namespace-level storage and helpers for bridge-assisted click actions.
Definition network_clicks.cpp:36
auto confirm(uint8_t clickableIndex, constants::ClickType clickType) -> bool
Stubbed confirmation path used when network clicks are compiled out.
Definition network_clicks.cpp:500
auto thereAreActiveNetworkClicks() -> bool
Reports no pending network clicks when the feature is compiled out.
Definition network_clicks.cpp:521
RequestResult
Definition network_clicks.hpp:44
@ Accepted
The request frame has been accepted by the UART and the request-timeout window is now active.
@ TransportRejected
The UART rejected the outgoing request frame.
@ AlreadyPending
The same clickable/clickType pair already has one in-flight transaction.
auto checkAllNetworkClicksTimers(bool failover) -> bool
Stubbed timeout sweep used when network clicks are compiled out.
Definition network_clicks.cpp:559
auto isNetworkClickExpired(uint8_t clickableIndex, constants::ClickType clickType) -> bool
Reports every network click as expired when the feature is compiled out.
Definition network_clicks.cpp:538
auto matchesCorrelationId(uint8_t clickableIndex, constants::ClickType clickType, uint8_t correlationId) -> bool
Stubbed correlation matcher used when network clicks are compiled out.
Definition network_clicks.cpp:510
auto request(uint8_t clickableIndex, constants::ClickType clickType) -> RequestResult
Stubbed request path used when network clicks are compiled out.
Definition network_clicks.cpp:490
void eraseNetworkClick(uint8_t clickableIndex, constants::ClickType clickType)
Stubbed erase path used when network clicks are compiled out.
Definition network_clicks.cpp:529
auto checkNetworkClickTimer(uint8_t clickableIndex, constants::ClickType clickType, bool failover) -> bool
Stubbed single-timer checker used when network clicks are compiled out.
Definition network_clicks.cpp:548
ClickType
Clickable (like button) click types.
Definition click_types.hpp:36