diff --git a/components/net/at/src/at_client.c b/components/net/at/src/at_client.c index 90fd3291c3a01cc8b8d16acd8e7dd8adce8f0327..8e5161f2cee566a99f67e104df6c25c6b0818bb5 100644 --- a/components/net/at/src/at_client.c +++ b/components/net/at/src/at_client.c @@ -355,10 +355,10 @@ static char at_client_getchar(void) { char ch; - if (rt_device_read(at_client_local->device, 0, &ch, 1) == 0) + while (rt_device_read(at_client_local->device, 0, &ch, 1) == 0) { + rt_sem_control(at_client_local->rx_notice, RT_IPC_CMD_RESET, RT_NULL); rt_sem_take(at_client_local->rx_notice, RT_WAITING_FOREVER); - rt_device_read(at_client_local->device, 0, &ch, 1); } return ch;