diff --git a/bsp/src/at_device_nt26k.c b/bsp/src/at_device_nt26k.c index 2f80eef..afe531b 100644 --- a/bsp/src/at_device_nt26k.c +++ b/bsp/src/at_device_nt26k.c @@ -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) diff --git a/bsp/src/bsp_nt26k.c b/bsp/src/bsp_nt26k.c index 755c655..1ea9d54 100644 --- a/bsp/src/bsp_nt26k.c +++ b/bsp/src/bsp_nt26k.c @@ -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)