将关闭TCP时间改为推荐时间

This commit is contained in:
小马_666 2025-02-14 14:15:05 +08:00
parent db30b6f7b3
commit b18b1f58ad
2 changed files with 6 additions and 4 deletions

View File

@ -299,7 +299,7 @@ void show_resp_info(at_response_t resp)
int at_device_nt26k_disconnect_tcp(struct at_device *device)
{
#define NT26K_CLOSE_REP_TIME (5 * AT_DEFAULT_TIMEOUT)
#define NT26K_CLOSE_REP_TIME (10 * AT_DEFAULT_TIMEOUT)
at_response_t resp = at_create_resp(AT_CLIENT_RECV_BUFF_LEN, 0, NT26K_CLOSE_REP_TIME);
if (resp == RT_NULL)

View File

@ -2,7 +2,7 @@
* @Author: mbw
* @Date: 2024-10-09 08:42:14
* @LastEditors: mbw && 1600520629@qq.com
* @LastEditTime: 2025-02-14 10:10:31
* @LastEditTime: 2025-02-14 12:04:59
* @FilePath: \JT-DT-YD4N02A_RTT_MRS-NT26K\bsp\src\bsp_nt26k.c
* @Description:
*
@ -1482,8 +1482,10 @@ static void Nt26k_Life_Thread_Entry(void *parameter)
result = -RT_ETIMEOUT;
goto __exit;
}
device->class->device_ops->control(device, AT_DEVICE_RF_CLOSE, RT_NULL);
rt_thread_mdelay(RT_TICK_PER_SECOND);//这里如果有TCP连接先关掉TCP,没有返回错误无所谓
if (device->class->device_ops->control(device, AT_DEVICE_CTRL_NET_DISCONN, RT_NULL) == RT_EOK) // 如果有socket,则关闭它,没有返回错误不用管
{
LOG_D("AT device close tcp success");
}
if (device->class->device_ops->control(device, AT_DEVICE_CTRL_WAKEUP, RT_NULL) == RT_EOK)
{
if (device->class->device_ops->control(device, AT_DEVICE_CTRL_POWER_ON, RT_NULL) == RT_EOK)