LSH-Core
Deterministic firmware core for Controllino-based Labo Smart Home nodes
 
Loading...
Searching...
No Matches
bridge_sync.hpp
Go to the documentation of this file.
1
21#ifndef LSH_CORE_COMMUNICATION_BRIDGE_SYNC_HPP
22#define LSH_CORE_COMMUNICATION_BRIDGE_SYNC_HPP
23
24#include <stdint.h>
25
26namespace BridgeSync
27{
28void begin(); // Start a fresh bridge handshake and send the first BOOT.
29void restartFromBridgeBoot(); // Re-open the handshake after a runtime BOOT request received from the bridge.
30void tick(uint16_t elapsed_ms); // Advance the bridge-sync state machine using the elapsed housekeeping time.
31void onRequestDetailsServed(); // Record that bridge details were served in the current session.
32void onRequestStateServed(); // Record that bridge state was served in the current session.
33[[nodiscard]] auto allowsStateRequests() -> bool; // Return true when REQUEST_STATE can be served safely.
34[[nodiscard]] auto allowsMutatingCommands() -> bool; // Return true when inbound bridge commands may change state.
35} // namespace BridgeSync
36
37#endif // LSH_CORE_COMMUNICATION_BRIDGE_SYNC_HPP
void onRequestDetailsServed()
Record that REQUEST_DETAILS has just been served.
Definition bridge_sync.cpp:151
auto allowsMutatingCommands() -> bool
Return whether inbound bridge commands may mutate controller state.
Definition bridge_sync.cpp:203
void begin()
Mark the bridge as out of sync and send the initial BOOT.
Definition bridge_sync.cpp:73
auto allowsStateRequests() -> bool
Return whether REQUEST_STATE may be served safely right now.
Definition bridge_sync.cpp:190
void tick(uint16_t elapsed_ms)
Advance the bridge synchronization state machine.
Definition bridge_sync.cpp:104
void restartFromBridgeBoot()
Re-open the handshake after the bridge explicitly requested a runtime resync.
Definition bridge_sync.cpp:88
void onRequestStateServed()
Record that REQUEST_STATE has just been served.
Definition bridge_sync.cpp:170