diff --git a/components/net/at/src/at_server.c b/components/net/at/src/at_server.c index a148a20ab05d204a40f49ace3ea6467b06879513..ebb37489b0623b4faaec0124524c49792d2eb9dd 100644 --- a/components/net/at/src/at_server.c +++ b/components/net/at/src/at_server.c @@ -352,10 +352,10 @@ static char at_server_gerchar(void) { char ch; - if (rt_device_read(at_server_local->device, 0, &ch, 1) == 0) + while (rt_device_read(at_server_local->device, 0, &ch, 1) == 0) { + rt_sem_control(at_server_local->rx_notice, RT_IPC_CMD_RESET, RT_NULL); rt_sem_take(at_server_local->rx_notice, RT_WAITING_FOREVER); - rt_device_read(at_server_local->device, 0, &ch, 1); } return ch;