Skip to content

Commit 0abd922

Browse files
mike-scottnashif
authored andcommitted
drivers: modem: wncm14a2a: correct comment in on_cmd_sockdataind()
The comment was incorrect explaining why we were sending an AT-command without waiting for a response (via a K_NO_WAIT timeout). Let's correct the comment and avoid confusion. Signed-off-by: Michael Scott <[email protected]>
1 parent e8a690f commit 0abd922

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

drivers/modem/wncm14a2a.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -946,8 +946,13 @@ static void on_cmd_sockdataind(struct net_buf **buf, u16_t len)
946946
snprintk(sendbuf, sizeof(sendbuf), "AT@SOCKREAD=%d,%d",
947947
sock->socket_id, left_bytes);
948948

949-
/* We still have a lock from hitting this cmd trigger,
950-
* so don't hold one when we send the new command
949+
/* We entered this trigger due to an unsolicited modem response.
950+
* When we send the AT@SOCKREAD command it won't generate an
951+
* "OK" response directly. The modem will respond with
952+
* "@SOCKREAD ..." and the data requested and then "OK" or
953+
* "ERROR". Let's not wait here by passing in a timeout to
954+
* send_at_cmd(). Instead, when the resulting response is
955+
* received, we trigger on_cmd_sockread() to handle it.
951956
*/
952957
send_at_cmd(sock, sendbuf, K_NO_WAIT);
953958
}

0 commit comments

Comments
 (0)