未验证 提交 5902e9a6 编写于 作者: armink_ztl's avatar armink_ztl 提交者: GitHub

Merge pull request #1693 from chenyong111/master

[net][at] Add AT serial device receive data length judgment.
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
#include <rtthread.h> #include <rtthread.h>
#define AT_SW_VERSION "0.2.2" #define AT_SW_VERSION "0.2.3"
#define DBG_ENABLE #define DBG_ENABLE
#define DBG_SECTION_NAME "AT" #define DBG_SECTION_NAME "AT"
......
...@@ -547,7 +547,7 @@ static void client_parser(at_client_t client) ...@@ -547,7 +547,7 @@ static void client_parser(at_client_t client)
/* get the end data by response result, return response state END_OK. */ /* get the end data by response result, return response state END_OK. */
client->resp_status = AT_RESP_OK; client->resp_status = AT_RESP_OK;
} }
else if ((memcmp(client->recv_buffer, AT_RESP_END_ERROR, strlen(AT_RESP_END_ERROR)) == 0) else if (strstr(client->recv_buffer, AT_RESP_END_ERROR)
|| (memcmp(client->recv_buffer, AT_RESP_END_FAIL, strlen(AT_RESP_END_FAIL)) == 0)) || (memcmp(client->recv_buffer, AT_RESP_END_FAIL, strlen(AT_RESP_END_FAIL)) == 0))
{ {
client->resp_status = AT_RESP_ERROR; client->resp_status = AT_RESP_ERROR;
...@@ -577,7 +577,11 @@ static void client_parser(at_client_t client) ...@@ -577,7 +577,11 @@ static void client_parser(at_client_t client)
static rt_err_t at_client_rx_ind(rt_device_t dev, rt_size_t size) static rt_err_t at_client_rx_ind(rt_device_t dev, rt_size_t size)
{ {
rt_sem_release(at_client_local->rx_notice); if (size > 0)
{
rt_sem_release(at_client_local->rx_notice);
}
return RT_EOK; return RT_EOK;
} }
......
...@@ -433,7 +433,10 @@ __retry: ...@@ -433,7 +433,10 @@ __retry:
static rt_err_t at_rx_ind(rt_device_t dev, rt_size_t size) static rt_err_t at_rx_ind(rt_device_t dev, rt_size_t size)
{ {
rt_sem_release(at_server_local->rx_notice); if (size > 0)
{
rt_sem_release(at_server_local->rx_notice);
}
return RT_EOK; return RT_EOK;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册