ha_mqtt.h
used by app_main.cpp app_shell.cpp ha_mqtt.c
API
Fvoid ha_mqtt_start_once(void)
Bring the publisher up once the station has an address. Idempotent and cheap: it only spawns the publisher task, which then does the NVS read, the TLS connect and every publish. Safe to call from the Matter event callback. No-op when the broker has not been provisioned.
Fvoid ha_mqtt_publish_distance_cm(int32_t cm)
Queue one conditioned approach distance, in centimetres (the estimate the unlock thresholds act on, not a raw block). Never blocks: a full queue drops the sample. Rate-limited to the agent's own interval before it is queued.
Fvoid ha_mqtt_publish_access(bool granted)
Queue one credential-independent access verdict. Never blocks: a full queue drops the event. Matches aliro_reader's access-listener signature, so it can be registered directly.
Fint ha_mqtt_shell_cmd(int argc, char **argv)
hamqtt console command: provision the broker, show state, start. Registered from app_shell.cpp alongside the other commands.