Files
ESP32_COMM/main/server/http_handlers.h
T
小龙虾 7a41eac526 refactor(ota): 移除ESP32 OTA架构中的高危设计问题并优化状态管理
- 移除OtaRelay职责过载问题,将状态查询统一收口到OtaCoordinator::getSnapshot()
- 新增OtaSnapshot结构体,一次性获取完整的OTA系统状态快照,避免分散读取
- 将GD32 APP探测逻辑从system_status_handler中分离,提供独立的/system/probe端点
- 修复并发安全隐患,确保processEvent()读取relayState时持有锁保护
- 优化SPI通信相关代码结构,提升系统稳定性

BREAKING CHANGE: 移除了原有的分散状态查询接口,统一使用快照方式获取状态
2026-06-23 00:05:56 +08:00

24 lines
702 B
C

#ifndef HTTP_HANDLERS_H
#define HTTP_HANDLERS_H
#include "esp_http_server.h"
// HTTP CORS and options
void http_set_cors_headers(httpd_req_t *req);
esp_err_t http_options_handler(httpd_req_t *req);
// OTA handlers
esp_err_t esp32_ota_update_handler(httpd_req_t *req);
esp_err_t ota_upload_handler(httpd_req_t *req);
esp_err_t ota_relay_trigger_handler(httpd_req_t *req);
esp_err_t restart_handler(httpd_req_t *req);
// Utility handlers
esp_err_t logs_handler(httpd_req_t *req);
esp_err_t can_send_handler(httpd_req_t *req);
esp_err_t spi_send_handler(httpd_req_t *req);
esp_err_t system_status_handler(httpd_req_t *req);
esp_err_t system_probe_handler(httpd_req_t *req);
#endif // HTTP_HANDLERS_H