ports/esp32/apps/matter-lock/main/ha_mqtt.h
openaliro/openaliro
Module

ha_mqtt.h

ports/esp32/apps/matter-lock/main/ha_mqtt.h

used by app_main.cpp app_shell.cpp ha_mqtt.c

API

Fvoid ha_mqtt_start_once(void)

ports/esp32/apps/matter-lock/main/ha_mqtt.h:38

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)

ports/esp32/apps/matter-lock/main/ha_mqtt.h:43

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)

ports/esp32/apps/matter-lock/main/ha_mqtt.h:48

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)

ports/esp32/apps/matter-lock/main/ha_mqtt.h:52

hamqtt console command: provision the broker, show state, start. Registered from app_shell.cpp alongside the other commands.