#pragma once
/*
 * hook_client.h — POST hook transitions to the Zacus master (Phase D).
 *
 * Ported from PLIP_FIRMWARE/src/zacus_hook_client.cpp to plain C / IDF.
 * Endpoint: POST <master_url>/voice/hook  { "state": "off"|"on", "reason": "..." }
 */

#include "esp_err.h"
#include <stdbool.h>

#ifdef __cplusplus
extern "C" {
#endif

/* Initialise (spawns worker task).  master_url: base URL e.g.
 * "http://192.168.0.188".  Pass NULL to use CONFIG_PLIP_MASTER_URL.
 * Idempotent — safe to call once from app_main. */
esp_err_t hook_client_init(const char *master_url);

/* Enqueue a state report (non-blocking).  state = "off"|"on",
 * reason = short free-form tag ("pickup", "hangup", "boot", ...).
 * Returns true if enqueued, false if queue was full. */
bool hook_client_report(const char *state, const char *reason);

#ifdef __cplusplus
}
#endif
