Skip to main content

Module Presence

ArmorLink tracks whether paired modules are online or offline.

Presence is managed by the Gateway and surfaced to the App through events and snapshots.

Activity-Based Detection

Whenever a paired module sends valid traffic to the Gateway, ArmorLink updates the module's last-seen timestamp.

Examples:

  • Commands
  • Logs
  • Telemetry
  • Configuration traffic
  • Pairing-related messages

A module is considered offline once it remains silent longer than moduleTimeoutMs.

Options

ArmorLinkOptions options;
options.modulePresenceCheckIntervalMs = 5000;
options.moduleTimeoutMs = 900000;
OptionDescription
modulePresenceCheckIntervalMsHow often the Gateway checks paired module state.
moduleTimeoutMsHow long a paired module may stay silent before it is considered offline.

App Events

The Gateway emits:

EventDescription
module_presence_snapshotFull paired-module snapshot sent on connect/request.
module_presenceOnline/offline update for one module.
module_unpairedModule was removed from the Gateway.
module_pairing_requiredModule talks to this Gateway but must be paired again.

Example snapshot:

{
"type": "module_presence_snapshot",
"pairedModuleCount": 1,
"modules": [
{
"name": "Helmet",
"type": "Helmet",
"mac": "E4:B3:23:C4:74:3C",
"moduleVersion": "1.0",
"armorLinkVersion": "0.4.0"
}
]
}

Apps should treat the snapshot as authoritative for the connected Gateway and remove local modules that are not present in it.

Runtime Hook

ArmorLink.setModuleTimeoutHook(
[](const ArmorLinkStoredPairedModule& module, uint32_t silentMs) {
ArmorLink.warn(String(module.name) + " went offline");
});

Summary

Presence is Gateway-managed and App-visible. Snapshots are used to keep local UI state aligned with the Gateway's actual paired module list.