at_tools: fix bugs

1 reset buffer before each read
2 increase sleep duration
This commit is contained in:
fujr 2025-01-19 02:03:48 +08:00
parent d66ae5e830
commit e9c43e11b1

View File

@ -133,6 +133,7 @@ int tty_read_keyword(FILE *fdi, char *output, int len, char *key_word, int soft_
int exitcode = TIMEOUT_WAITING_NEWLINE;
while (difftime(time(NULL), start_time) < soft_timeout)
{
memset(tmp, 0, LINE_BUF);
if (fgets(tmp, LINE_BUF, fdi))
{
read_flag = 1;
@ -176,7 +177,7 @@ int tty_read_keyword(FILE *fdi, char *output, int len, char *key_word, int soft_
}
}
#endif
usleep(1000);
usleep(10000);
}
if (read_flag == 0)
{