|
Protective Stop
|
Periodically POSTs a device check-in to <base_url>/api/v1/checkin. More...
#include <fleet_checkin.hpp>
Public Member Functions | |
| FleetCheckin (FleetCheckinConfig config, uint32_t machine_id, std::function< MachineSnapshot()> snapshot_fn) | |
| FleetCheckin (const FleetCheckin &)=delete | |
| FleetCheckin & | operator= (const FleetCheckin &)=delete |
| bool | start () |
| Launches the check-in thread. | |
| void | stop () |
| Stops the thread and joins. Idempotent. | |
| bool | enabled () const |
| True while the check-in thread is running. | |
Periodically POSTs a device check-in to <base_url>/api/v1/checkin.
The payload follows the ESP32 check-in schema, so the fleet registers this software machine as a device_type:"machine" device. An update_available directive in the response is logged only. Runs on its own thread, off the safety path: failures only log. Driven from the node's activate/deactivate transitions, so it runs only while the node is ACTIVE. start() and stop() are idempotent.
| protective_stop_machine::FleetCheckin::FleetCheckin | ( | FleetCheckinConfig | config, |
| uint32_t | machine_id, | ||
| std::function< MachineSnapshot()> | snapshot_fn ) |
| config | Deployment values. |
| machine_id | Device ID of this machine. |
| snapshot_fn | Returns the state to report; called from the check-in thread. |
| bool protective_stop_machine::FleetCheckin::start | ( | ) |
Launches the check-in thread.