Fix web OTA upload and isolate OTA sessions across firmware and goTool.
Split ESP-NOW into core/master/slave modules, block non-OTA UART traffic during updates, and hold the host serial port exclusively so dashboard polling cannot interleave with firmware uploads. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -9,13 +9,29 @@ static void handle_ota_slave_progress(const uint8_t *data, size_t len) {
|
||||
alox_UartMessage uart_msg;
|
||||
uint32_t filter = 0;
|
||||
|
||||
if (uart_cmd_decode(data, len, &uart_msg) == ESP_OK) {
|
||||
if (len > 0) {
|
||||
if (uart_cmd_decode(data, len, &uart_msg) != ESP_OK) {
|
||||
ESP_LOGW(TAG, "decode failed");
|
||||
alox_UartMessage response;
|
||||
uart_cmd_init_response(
|
||||
&response, alox_MessageType_OTA_SLAVE_PROGRESS,
|
||||
alox_UartMessage_ota_slave_progress_response_tag);
|
||||
uart_cmd_send(&response, TAG);
|
||||
return;
|
||||
}
|
||||
const alox_OtaSlaveProgressRequest *req =
|
||||
UART_CMD_REQ(&uart_msg, alox_UartMessage_ota_slave_progress_request_tag,
|
||||
ota_slave_progress_request);
|
||||
if (req != NULL) {
|
||||
filter = req->client_id;
|
||||
if (req == NULL) {
|
||||
ESP_LOGW(TAG, "missing ota_slave_progress_request");
|
||||
alox_UartMessage response;
|
||||
uart_cmd_init_response(
|
||||
&response, alox_MessageType_OTA_SLAVE_PROGRESS,
|
||||
alox_UartMessage_ota_slave_progress_response_tag);
|
||||
uart_cmd_send(&response, TAG);
|
||||
return;
|
||||
}
|
||||
filter = req->client_id;
|
||||
}
|
||||
|
||||
alox_UartMessage response;
|
||||
|
||||
Reference in New Issue
Block a user