Presence API
The Presence API allows Gateways to monitor module availability and react when modules become unavailable.
For the conceptual overview, see Module Presence.
setModuleTimeoutHook(...)
Registers a callback that is executed when a module exceeds the configured timeout.
ArmorLink.setModuleTimeoutHook(
[](const ArmorLinkStoredPairedModule& module,
uint32_t silentMs)
{
ArmorLink.warn(
String(module.name) + " went offline"
);
});
Parameters
| Parameter | Description |
|---|---|
| module | Information about the paired module |
| silentMs | Milliseconds since the last communication |
isModuleOnline(...)
Checks whether a module is currently considered online.
if (ArmorLink.isModuleOnline(mac))
{
ArmorLink.info("Module online");
}
Returns:
true
when the module is currently online.
Returns:
false
when the module has timed out or is unknown.
Summary
The Presence API provides:
- Offline detection callbacks
- Online state checks
- Gateway-side monitoring
- Integration with ArmorLink presence management