修复了网络参数的保存逻辑
This commit is contained in:
@@ -62,6 +62,27 @@ typedef struct {
|
||||
*/
|
||||
int net_init(const char *ip, const char *mask, const char *gateway, const uint8_t *mac);
|
||||
|
||||
/*
|
||||
* 函数功能:取网络代次号
|
||||
* 入口参数:无
|
||||
* 返回值:代次号(每次网络重建完成递增) uint32_t
|
||||
* 限定条件:无
|
||||
* 函数说明:TCP 服务(FTP / 对时 / 远程显示)据此感知"网络已重建"——代次变化
|
||||
* 表示旧 Socket 已随芯片复位失效,服务应放弃旧监听并重建。
|
||||
* 递增点在 net_stack_bring_up() 末尾(PHY/链路就绪后),避免服务在网络
|
||||
* 尚未可用时抢先重建、也避免 uiTask 阻塞在消息队列上。
|
||||
*/
|
||||
uint32_t net_get_generation(void);
|
||||
|
||||
/*
|
||||
* 函数功能:递增网络代次号(网络重建完成、对外可用时调用)
|
||||
* 入口参数:无
|
||||
* 返回值:无
|
||||
* 限定条件:net_init() 成功且 PHY/链路就绪后调用(当前仅 net_stack_bring_up)
|
||||
* 函数说明:见 net_get_generation()
|
||||
*/
|
||||
void net_generation_inc(void);
|
||||
|
||||
/*
|
||||
* 函数功能:轮询所有 Socket 状态(必须在主循环中调用)
|
||||
* 返回值:有事件发生的 socket 数量
|
||||
|
||||
Reference in New Issue
Block a user