Initial commit: CCU621_M firmware project with BLE debug link support.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
/**
|
||||
* @file lwip_ftp_upgrade.h
|
||||
* @brief 基于 LwIP socket 的 FTP 固件升级状态机(网线远程升级)
|
||||
*
|
||||
* 说明:
|
||||
* - 参考 ec200a_4g_ftp.c 的“状态机 + 周期调用”风格;
|
||||
* - 通过 LwIP socket 实现 FTP 控制/数据连接,按 1024 字节分包写入升级区域;
|
||||
* - 每次调用只推进一小步,不阻塞 v_Plat_Comm 线程。
|
||||
*/
|
||||
#ifndef LWIP_FTP_UPGRADE_H
|
||||
#define LWIP_FTP_UPGRADE_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief 初始化 LwIP FTP 升级状态机
|
||||
*
|
||||
* 说明:
|
||||
* - 直接读取全局 t_ftp_update_info 中的 FTP 参数(server/port/user/pass/path/file_name);
|
||||
* - 清空内部静态状态结构体,关闭残留 socket,准备进入 CONNECT 步骤。
|
||||
*/
|
||||
void lwip_ftp_upgrade_init_from_tftp(void);
|
||||
|
||||
/**
|
||||
* @brief 周期推进 LwIP FTP 升级状态机(单步)
|
||||
*
|
||||
* 返回值:
|
||||
* - 0:升级进行中(下次调用继续推进);
|
||||
* - 1:升级成功完成(文件全部下载且升级头标记为 NEED_UP);
|
||||
* - <0:升级失败(FTP/网络/Flash 错误等,具体原因在日志中打印)。
|
||||
*/
|
||||
int lwip_ftp_upgrade_step(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* LWIP_FTP_UPGRADE_H */
|
||||
|
||||
Reference in New Issue
Block a user