23 lines
765 B
C
23 lines
765 B
C
#pragma once
|
|
|
|
#include <stdbool.h>
|
|
#include <stdint.h>
|
|
#include "esp_err.h"
|
|
|
|
#define MQTT_HOST_MAX_LEN 128
|
|
#define MQTT_URI_MAX_LEN 256
|
|
|
|
esp_err_t config_store_init(void);
|
|
bool config_store_is_provisioned(void);
|
|
esp_err_t config_store_set_provisioned(void);
|
|
esp_err_t config_store_clear_provisioned(void);
|
|
|
|
/* Store an optional manual MQTT broker override (used if mDNS fails). */
|
|
esp_err_t config_store_set_mqtt_override(const char *host, uint16_t port);
|
|
|
|
/* Returns ESP_ERR_NVS_NOT_FOUND if no override is stored. */
|
|
esp_err_t config_store_get_mqtt_override(char host_out[MQTT_HOST_MAX_LEN], uint16_t *port_out);
|
|
|
|
/* Returns ESP_ERR_NVS_NOT_FOUND if no override is stored. */
|
|
esp_err_t config_store_get_mqtt_override_uri(char *uri_out, size_t uri_max_len);
|