【修改】esp8266_socket_close 函数中返回错误

Signed-off-by: chenyong <1521761801@qq.com>
This commit is contained in:
chenyong 2018-07-21 11:50:16 +08:00
parent f5bf545bf2
commit 8054ecc855
1 changed files with 3 additions and 1 deletions

View File

@ -87,6 +87,7 @@ static int at_socket_event_recv(uint32_t event, uint32_t timeout, rt_uint8_t opt
static int esp8266_socket_close(int socket)
{
rt_at_response_t resp = RT_NULL;
int result = RT_EOK;
resp = rt_at_create_resp(64, 0, rt_tick_from_millisecond(5000));
if (!resp)
@ -100,6 +101,7 @@ static int esp8266_socket_close(int socket)
if (rt_at_exec_cmd(resp, "AT+CIPCLOSE=%d", socket) < 0)
{
LOG_E("socket(%d) close failed.", socket);
result = -RT_ERROR;
goto __exit;
}
@ -111,7 +113,7 @@ static int esp8266_socket_close(int socket)
rt_at_delete_resp(resp);
}
return RT_EOK;
return result;
}
/**