From 2c89bb82086b3bfacea6574aea4c99bd9924ff8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AD=94=E7=BD=97?= Date: Sun, 28 Nov 2021 15:57:36 +0800 Subject: [PATCH] =?UTF-8?q?1.=E6=8C=89=E5=8D=95=E5=AD=97=E7=AC=A6=E5=A4=84?= =?UTF-8?q?=E7=90=86=E6=8E=A5=E6=94=B6,=E9=81=BF=E5=85=8D=E5=87=BA?= =?UTF-8?q?=E7=8E=B0=E5=9C=A8urc=E4=BA=8B=E4=BB=B6=E4=B8=AD=E8=AF=BB?= =?UTF-8?q?=E5=8F=96=E6=95=B0=E6=8D=AE=E6=97=B6,=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E5=90=8E=E9=9D=A2=E6=95=B0=E6=8D=AE=E4=B8=A2=E5=A4=B1=E9=97=AE?= =?UTF-8?q?=E9=A2=98.=202.=E8=A7=A3=E5=86=B3=E5=A4=9A=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E5=8F=91=E9=80=81=E6=97=B6,=E6=8E=A5=E6=94=B6=E5=AE=8C?= =?UTF-8?q?=E6=88=90=E4=BF=A1=E5=8F=B7=E9=87=8F=E6=8F=90=E5=89=8D=E9=87=8A?= =?UTF-8?q?=E6=94=BE=E7=9A=84=E9=97=AE=E9=A2=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- at.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/at.c b/at.c index ca00303..30b58f1 100644 --- a/at.c +++ b/at.c @@ -16,6 +16,8 @@ * 2021-04-08 Morro 解决重复释放信号量导致命令出现等待超时的问题 * 2021-05-15 Morro 优化URC匹配程序 * 2021-07-20 Morro 增加锁,解决执行at_do_work时urc部分数据丢失问题 + * 2021-11-20 Morro 按单字符处理接收,避免出现在urc事件中读取数据时 + * 导致后面数据丢失问题 ****************************************************************************** */ #include "at.h" @@ -317,7 +319,9 @@ static void urc_recv_process(at_obj_t *at, const char *buf, unsigned int size) */ static void resp_notification(at_obj_t *at, at_return ret) { - at->ret = ret; + at->ret = ret; + at->resp = NULL; + at_sem_post(at->completed); } @@ -398,7 +402,7 @@ void at_resume(at_obj_t *at) */ void at_process(at_obj_t *at) { - char buf[16]; + char buf[1]; unsigned int len; if (!at_sem_wait(at->recv_lock, MAX_AT_LOCK_TIME)) return;