Skip to content

Commit 09e9736

Browse files
emillindqjukkar
authored andcommitted
drivers: modem: ublox-sara-r4: remove redundant wait after sendto
According to AT commands manual, no wait after prompt '@' is required if using AT+USOST commmand (aka. sendto, only used with UDP). Signed-off-by: Emil Lindqvist <[email protected]>
1 parent 3302896 commit 09e9736

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

drivers/modem/ublox-sara-r4.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,8 +380,15 @@ static ssize_t send_socket_data(void *obj,
380380
/* Wait for prompt '@' */
381381
k_sem_take(&mdata.sem_prompt, K_FOREVER);
382382

383-
/* slight pause per spec so that @ prompt is received */
384-
k_sleep(MDM_PROMPT_CMD_DELAY);
383+
/*
384+
* The AT commands manual requires a 50 ms wait
385+
* after '@' prompt if using AT+USOWR, but not
386+
* if using AT+USOST. This if condition is matched with
387+
* the command selection above.
388+
*/
389+
if (sock->ip_proto != IPPROTO_UDP) {
390+
k_sleep(MDM_PROMPT_CMD_DELAY);
391+
}
385392

386393
/* Reset response semaphore before sending data
387394
* So that we are sure that we won't use a previously pending one

0 commit comments

Comments
 (0)