Files
ESP32_COMM/main/server/ble_ota.h
T
小龙虾 1586a81b97 feat(main): 将全局函数重构为单例类模式
- 将 debug_log 模块重构为 DebugLog 单例类,封装 UART、UDP 和环形缓冲区日志输出
- 将 health_monitor 模块重构为 HealthMonitor 单例类,统一健康状态管理和监控逻辑
- 更新 main.cpp 中的初始化调用,使用单例实例替代原有全局函数
- 添加健康监控任务作为第四个 FreeRTOS 任务,增强系统监控能力
- 更新固件版本从 0.2.11 到 0.3.0,反映架构重大变更
2026-05-31 03:20:26 +08:00

37 lines
903 B
C++

/*
* ble_ota.h - BLE OTA GATT 服务器
* T5.1 - T5.5
*/
#ifndef BLE_OTA_H
#define BLE_OTA_H
#include <stdint.h>
#include "esp_err.h"
#include "esp_ota_ops.h"
class BleOta {
public:
static BleOta& instance();
static void taskEntry(void *pvParameters);
esp_err_t serverStart();
esp_err_t notifyResponse(const uint8_t *data, size_t len);
bool isConnected();
void signalRelay();
// 以下状态为 public,供 C 回调函数访问
bool m_bleReady = false;
bool m_bleConnected = false;
uint16_t m_connHandle = 0xFFFF;
uint16_t mDataOutValHandle = 0;
bool m_esp32OtaActive = false;
esp_ota_handle_t m_esp32OtaHandle = 0;
const esp_partition_t *m_esp32UpdatePartition = NULL;
size_t m_esp32Received = 0;
bool m_esp32RebootPending = false;
uint8_t m_esp32LastCmd = 0;
uint16_t m_esp32LastSeq = 0xFFFFU;
};
#endif // BLE_OTA_H