feat: implement OTA updates over HTTP(S), initiated over MQTT
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
#define MQTT_DESELECTED_BIT BIT4
|
||||
#define MQTT_FACTORY_RESET_BIT BIT5
|
||||
#define MQTT_RECONFIGURE_SETTINGS_BIT BIT6
|
||||
#define MQTT_OTA_BIT BIT7
|
||||
|
||||
/* Populated by handle_cmd() before MQTT_RECONFIGURE_SETTINGS_BIT is set.
|
||||
* All fields are optional — empty string means "not provided, leave unchanged". */
|
||||
@@ -27,6 +28,18 @@ typedef struct {
|
||||
* MQTT_RECONFIGURE_SETTINGS_BIT fires; must be read before the next MQTT event. */
|
||||
const mqtt_reconfigure_data_t *mqtt_publisher_get_reconfigure_data(void);
|
||||
|
||||
typedef struct {
|
||||
char url[256];
|
||||
char version[32];
|
||||
} mqtt_ota_data_t;
|
||||
|
||||
/** Returns a pointer to the last parsed OTA payload. Valid only after
|
||||
* MQTT_OTA_BIT fires; must be read before the next MQTT event. */
|
||||
const mqtt_ota_data_t *mqtt_publisher_get_ota_data(void);
|
||||
|
||||
/** Publish OTA status to localiser/sensor/{id}/ota. Non-blocking (QoS 1). */
|
||||
void mqtt_publisher_send_ota_status(const char *status, const char *version);
|
||||
|
||||
/**
|
||||
* Initialise and connect the MQTT client.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user