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 <m.niestroj@grinn-global.com>
This commit is contained in:
Marcin Niestroj 2020-12-11 19:46:26 +01:00 committed by Jukka Rissanen
commit 1b680c8234

View file

@ -1660,7 +1660,9 @@ static int offload_connect(struct net_context *context,
sock->socket_id, wncm14a2a_sprint_ip_addr(addr),
dst_port, timeout_sec);
ret = send_at_cmd(sock, buf, MDM_CMD_CONN_TIMEOUT);
if (ret < 0) {
if (!ret) {
net_context_set_state(sock->context, NET_CONTEXT_CONNECTED);
} else {
LOG_ERR("AT@SOCKCONN ret:%d", ret);
}