Skip to content

Commit

Permalink
samples: wifi: sta: Fix 5GHz connection
Browse files Browse the repository at this point in the history
Now that WPA supplicant APIs enforce band requirement, need to properly
configure the band in the connection as 0 (memset) is 2.4GHz only.

Signed-off-by: Chaitanya Tata <[email protected]>
  • Loading branch information
krish2718 authored and nordicjm committed Nov 7, 2023
1 parent de39a8b commit 43f5bb7
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions samples/wifi/sta/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,12 @@ static int __wifi_args_to_params(struct wifi_connect_req_params *params)
params->timeout = SYS_FOREVER_MS;
}

/* Defaults */
params->band = WIFI_FREQ_BAND_UNKNOWN;
params->channel = WIFI_CHANNEL_ANY;
params->security = WIFI_SECURITY_TYPE_NONE;
params->mfp = WIFI_MFP_OPTIONAL;

/* SSID */
params->ssid = CONFIG_STA_SAMPLE_SSID;
params->ssid_length = strlen(params->ssid);
Expand All @@ -234,10 +240,6 @@ static int __wifi_args_to_params(struct wifi_connect_req_params *params)
params->psk = CONFIG_STA_SAMPLE_PASSWORD;
params->psk_length = strlen(params->psk);
#endif
params->channel = WIFI_CHANNEL_ANY;

/* MFP (optional) */
params->mfp = WIFI_MFP_OPTIONAL;

return 0;
}
Expand Down

0 comments on commit 43f5bb7

Please sign in to comment.