refactor: 清理遗留死代码(−353 行)

仓库经多轮迭代积累了不少不再被引用的中间件代码。本次以当前前端依赖的
HTTP 端点为基准(/system/status、/logs、/can/send、/spi/send、/ota/upload、
/ota/update、/ota/relay、/restart),移除以下模块的未引用代码:

- main/transport/protocol.{h,cpp}(−257 行)
  * 移除 CMD_* / ACK_* 宏(CMD_HANDSHAKE_REQ 等 16 个)
  * 移除未引用方法:crc16Modbus、buildFrame、parseFrame、aesEncrypt、
    aesDecrypt、sessionEncrypt、sessionDecrypt、generateRandomNonce
  * 保留 init / scrambleGenerate / sessionKeyInit / sessionKeyClear
    (被 ota_relay 实际调用)

- main/relay/ota_relay.{h,cpp}(−84 行)
  * 移除未引用方法:startHandshake、probeBootHandshake、isStructuredAckWithPayload
  * 移除未使用枚举值:RELAY_HANDSHAKE_IDLE、RELAY_RECEIVING、RELAY_TRANSFER_DONE
  * 移除字段 ota_meta_t.chunk_count 与宏 OTA_META_NVS_KEY

- main/server/wifi_ota.cpp(−255 行)
  * 移除 6 个未被前端调用的 HTTP 端点:/health、/wifi/status、/can/status、
    /ota/status、/ota/esp32_status、/api/version
  * 移除其处理器与路由注册
  * 移除 mbedtls/private/sha256.h 直接引用(SHA-256 已委托 Esp32OtaCore)

- main/server/ble_ota.cpp、main/relay/ota_relay.cpp
  * 同步移除 chunk_count 引用
This commit is contained in:
小龙虾
2026-06-15 00:24:29 +08:00
parent 9ca53ae66e
commit 929faf1d38
9 changed files with 565 additions and 744 deletions
+2 -2
View File
@@ -8,7 +8,7 @@
#define FW_VERSION_STRING "0.3.12"
// 编译时间
#define BUILD_TIME "2026-06-14 22:46:58"
#define BUILD_TIME "2026-06-14 23:55:14"
// Git 信息
#define GIT_HASH "2caf10b"
#define GIT_HASH "unknown"