#pragma once
/* net.h — WiFi STA + HTTP server for PLIP voice annex. */
#include "esp_err.h"
#include "esp_http_server.h"
#include <stdbool.h>

#ifdef __cplusplus
extern "C" {
#endif

/* Start WiFi STA (creds from NVS or Kconfig fallback) + httpd on port 80.
 * Blocks until connected or 30 s elapses.
 * Returns ESP_OK on success; ESP_ERR_TIMEOUT if WiFi failed (board continues
 * offline — httpd is NOT started in that case). */
esp_err_t net_init(void);

/* Returns true once the WiFi STA has obtained an IP address. */
bool net_is_connected(void);

/* Expose the httpd handle so other modules can register additional URI
 * handlers after net_init() succeeds. Returns NULL if not yet started. */
httpd_handle_t net_httpd_handle(void);

#ifdef __cplusplus
}
#endif
