Merge pull request #24 from chenyong111/master

【修改】EC20 细节改动
This commit is contained in:
朱天龙 (Armink) 2018-08-30 13:06:17 +08:00 committed by GitHub
commit 2b21be6e5e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 22 deletions

View File

@ -450,28 +450,9 @@ static int ec20_socket_close(int socket)
} }
/* default connection timeout is 10 seconds, but it set to 1 seconds is convenient to use.*/ /* default connection timeout is 10 seconds, but it set to 1 seconds is convenient to use.*/
result = at_exec_cmd(resp, "AT+QICLOSE=%d,1", socket); result = at_exec_cmd(resp, "AT+QICLOSE=%d,1", socket);
if (result < 0)
/* result == RT_EOK means close command received, we need to check more resps*/
if (result == RT_EOK)
{ {
if (at_resp_get_line_by_kw(resp, "OK") != RT_NULL) LOG_E("socket (%d) close failed, wait close OK timeout or ERROR.", socket);
{
goto __exit;
}
else if (at_resp_get_line_by_kw(resp, "ERROR") != RT_NULL)
{
LOG_E("socket (%d) close failed, \"ERROR\" returned.", socket);
goto __exit;
}
else
{
LOG_E("socket (%d) close failed, not \"OK\" OR \"ERROR\" returned.", socket);
goto __exit;
}
}
else if (result == -RT_ETIMEOUT)
{
LOG_E("socket (%d) close failed, wait close OK timeout.", socket);
} }
__exit: __exit:
@ -1367,7 +1348,7 @@ int ec20_ifconfig(void)
/* Query the status of the context profile */ /* Query the status of the context profile */
AT_SEND_CMD(resp, 0, 150 * 1000, "AT+QIACT?"); AT_SEND_CMD(resp, 0, 150 * 1000, "AT+QIACT?");
at_resp_parse_line_args_by_kw(resp, "+QIACT:", "+QIACT: %*[^\"]\"%[^\"]", &resp_arg); at_resp_parse_line_args_by_kw(resp, "+QIACT:", "+QIACT: %*[^\"]\"%[^\"]", &resp_arg);
LOG_D("ip adress : %s", resp_arg); rt_kprintf("IP adress : %s\n", resp_arg);
__exit: __exit:
if (resp) if (resp)