Files
ESP32_COMM/main/server/ble_ota.h
T
小龙虾 6a6bc9dab4 feat(version): 更新固件版本号至 0.3.12,修正编译时间和 Git 哈希
feat(ble): 增加 BLE OTA 窗口确认机制,优化数据包处理
fix(html): 更新链接以在新标签页中打开,改善用户体验
2026-06-13 01:24:11 +08:00

36 lines
867 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;
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