Merge pull request #8 from chenyong111/master

【修改】esp8266_socket_close 函数中返回错误
This commit is contained in:
朱天龙 (Armink) 2018-07-21 12:49:55 +08:00 committed by GitHub
commit 76b2f40154
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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;
}
/**