Presence API
The Presence API lets Gateway firmware inspect module availability and react when paired modules become unavailable.
For the conceptual overview, see Module Presence.
setModuleTimeoutHook
Registers a callback that runs when a paired module exceeds the configured timeout.
ArmorLink.setModuleTimeoutHook(
[](const ArmorLinkStoredPairedModule& module, uint32_t silentMs) {
ArmorLink.warn(String(module.name) + " went offline");
});
| Parameter | Description |
|---|---|
module | Stored paired module metadata. |
silentMs | Milliseconds since the last observed traffic. |
isModuleOnline
Checks whether a module is currently considered online.
if (ArmorLink.isModuleOnline("E4:B3:23:C4:74:3C")) {
ArmorLink.info("Helmet online");
}
Returns true for known modules that are currently online, otherwise false.
Gateway Events
Presence is also exposed to BLE/App clients:
module_presence_snapshotmodule_presencemodule_unpairedmodule_pairing_required
These events are generated by the Gateway and are intended for UI synchronization.
Summary
Use the Presence API for Gateway-side decisions. Use the App-facing events to keep user interfaces aligned with the Gateway's paired-module list.