feat: handle factory_reset and reconfigure_settings commands
This commit is contained in:
@@ -3,13 +3,29 @@
|
||||
#include "esp_err.h"
|
||||
#include "freertos/FreeRTOS.h"
|
||||
#include "freertos/event_groups.h"
|
||||
#include <stdint.h>
|
||||
|
||||
/* Event bits set by the MQTT publisher into the shared event group */
|
||||
#define MQTT_CONNECTED_BIT BIT0
|
||||
#define MQTT_CALIBRATE_START BIT1
|
||||
#define MQTT_CALIBRATE_STOP BIT2
|
||||
#define MQTT_SELECTED_BIT BIT3
|
||||
#define MQTT_DESELECTED_BIT BIT4
|
||||
#define MQTT_CONNECTED_BIT BIT0
|
||||
#define MQTT_CALIBRATE_START BIT1
|
||||
#define MQTT_CALIBRATE_STOP BIT2
|
||||
#define MQTT_SELECTED_BIT BIT3
|
||||
#define MQTT_DESELECTED_BIT BIT4
|
||||
#define MQTT_FACTORY_RESET_BIT BIT5
|
||||
#define MQTT_RECONFIGURE_SETTINGS_BIT BIT6
|
||||
|
||||
/* Populated by handle_cmd() before MQTT_RECONFIGURE_SETTINGS_BIT is set.
|
||||
* All fields are optional — empty string means "not provided, leave unchanged". */
|
||||
typedef struct {
|
||||
char ssid[32];
|
||||
char password[64];
|
||||
char mqtt_host[128];
|
||||
uint16_t mqtt_port;
|
||||
} mqtt_reconfigure_data_t;
|
||||
|
||||
/** Returns a pointer to the last parsed reconfigure payload. Valid only after
|
||||
* MQTT_RECONFIGURE_SETTINGS_BIT fires; must be read before the next MQTT event. */
|
||||
const mqtt_reconfigure_data_t *mqtt_publisher_get_reconfigure_data(void);
|
||||
|
||||
/**
|
||||
* Initialise and connect the MQTT client.
|
||||
|
||||
Reference in New Issue
Block a user