Skip to content

Commit 65dd0f4

Browse files
mniestrojjukkar
authored andcommitted
drivers: wifi: winc1500: set NET_CONTEXT_CONNECTED state
Set NET_CONTEXT_CONNECTED when stream socket got connected. This fixes TCP connection when using winc1500 WiFi 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 9af6b9e commit 65dd0f4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/wifi/winc1500/wifi_winc1500.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -763,6 +763,10 @@ static void handle_socket_msg_connect(struct socket_data *sd, void *pvMsg)
763763
LOG_ERR("CONNECT: socket %d error %d",
764764
strConnMsg->sock, strConnMsg->s8Error);
765765

766+
if (!strConnMsg->s8Error) {
767+
net_context_set_state(sd->context, NET_CONTEXT_CONNECTED);
768+
}
769+
766770
if (sd->connect_cb) {
767771
sd->connect_cb(sd->context,
768772
strConnMsg->s8Error,

0 commit comments

Comments
 (0)