Skip to content

Commit 1b680c8

Browse files
mniestrojjukkar
authored andcommitted
drivers: modem: wncm14a2a: set NET_CONTEXT_CONNECTED state
Set NET_CONTEXT_CONNECTED when stream socket got connected. This fixes TCP connection when using wncm14a2a modem driver, which got broken after sockets layer started to validate net_context connection state before allowing to receive any data. Signed-off-by: Marcin Niestroj <[email protected]>
1 parent 27b268f commit 1b680c8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/modem/wncm14a2a.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1660,7 +1660,9 @@ static int offload_connect(struct net_context *context,
16601660
sock->socket_id, wncm14a2a_sprint_ip_addr(addr),
16611661
dst_port, timeout_sec);
16621662
ret = send_at_cmd(sock, buf, MDM_CMD_CONN_TIMEOUT);
1663-
if (ret < 0) {
1663+
if (!ret) {
1664+
net_context_set_state(sock->context, NET_CONTEXT_CONNECTED);
1665+
} else {
16641666
LOG_ERR("AT@SOCKCONN ret:%d", ret);
16651667
}
16661668

0 commit comments

Comments
 (0)