Skip to content

Commit ee2ae7f

Browse files
committed
samples: wifi_provisioning_over_ble: Zero-init cnx_params to fix reconnect
Initialize wifi_connect_req_params to zero to avoid undefined values in struct fields that caused reconnection to fail. This makes repeated connects stable. Signed-off-by: Tejus R S <ters@silabs.com>
1 parent e75e331 commit ee2ae7f

File tree

1 file changed

+1
-0
lines changed
  • samples/wifi_provisioning_over_ble/src

1 file changed

+1
-0
lines changed

samples/wifi_provisioning_over_ble/src/main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ void do_wifi_connect(void)
174174
printk("\r\nmalloc failed\r\n");
175175
return;
176176
}
177+
memset(cnx_params, 0, sizeof(struct wifi_connect_req_params));
177178
context.connecting = true;
178179
cnx_params->channel = WIFI_CHANNEL_ANY;
179180
cnx_params->band = 0;

0 commit comments

Comments
 (0)