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:
Xavier Chapron 2021-01-22 09:21:12 +01:00 committed by Anas Nashif
commit 47da2bed27

View file

@ -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