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;