drivers: modem: sara-r4: Add sanity timeout for @ prompt
This wait on @ prompt was added in
fa3d586483
.
The situation were the @ prompt is never received should not occurs,
however it's definitively safer to catch it instead of having a
deadlock.
Signed-off-by: Xavier Chapron <xavier.chapron@stimio.fr>
This commit is contained in:
parent
609701fa21
commit
47da2bed27
1 changed files with 6 additions and 1 deletions
|
@ -378,7 +378,12 @@ static ssize_t send_socket_data(void *obj,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Wait for prompt '@' */
|
/* Wait for prompt '@' */
|
||||||
k_sem_take(&mdata.sem_prompt, K_FOREVER);
|
ret = k_sem_take(&mdata.sem_prompt, K_SECONDS(1));
|
||||||
|
if (ret != 0) {
|
||||||
|
ret = -ETIMEDOUT;
|
||||||
|
LOG_ERR("No @ prompt received");
|
||||||
|
goto exit;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The AT commands manual requires a 50 ms wait
|
* The AT commands manual requires a 50 ms wait
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue