From 3b7c7499c543bfc9e79fde6fe6f659d47d76c834 Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Thu, 12 Dec 2024 20:13:12 +0530 Subject: [PATCH] Implement the missing profiles Mainly for scan_type and dwell times. Signed-off-by: Chaitanya Tata --- samples/scan_bm/Kconfig | 16 ++++++++++++++++ samples/scan_bm/src/main.c | 9 +++++++++ 2 files changed, 25 insertions(+) diff --git a/samples/scan_bm/Kconfig b/samples/scan_bm/Kconfig index f8f777d..6d688d2 100644 --- a/samples/scan_bm/Kconfig +++ b/samples/scan_bm/Kconfig @@ -66,6 +66,16 @@ config WIFI_SCAN_DWELL_TIME_PASSIVE help Passive scan dwell time (in ms) per channel. +config WIFI_SCAN_TYPE_ACTIVE + bool "Active scan" + help + Enable this profile to do active scan where allowed. + +config WIFI_SCAN_TYPE_PASSIVE + bool "Passive scan" + help + Enable this profile to do passive scan on all channels. + choice prompt "Choose a WiFi Scan Profile" @@ -76,31 +86,37 @@ config WIFI_SCAN_PROFILE_DEFAULT config WIFI_SCAN_PROFILE_ACTIVE bool "Active scan" + select WIFI_SCAN_TYPE_ACTIVE help Enable this profile to do active scan where allowed. config WIFI_SCAN_PROFILE_PASSIVE bool "Passive scan" + select WIFI_SCAN_TYPE_PASSIVE help Enable this profile to do passive scan on all channels. config WIFI_SCAN_PROFILE_2_4GHz_ACTIVE bool "Scan in the 2.4 GHz band using active scan" + select WIFI_SCAN_TYPE_ACTIVE help Enable this profile to scan in the 2.4 GHz band using active scanning where allowed. config WIFI_SCAN_PROFILE_2_4GHz_PASSIVE bool "Scan in the 2.4 GHz band using passive scan" + select WIFI_SCAN_TYPE_PASSIVE help Enable this profile to scan in the 2.4 GHz band using passive scanning on all channels. config WIFI_SCAN_PROFILE_5GHz_ACTIVE bool "Scan in the 5 GHz band using active scan" + select WIFI_SCAN_TYPE_ACTIVE help Enable this profile to scan in the 5 GHz band using active scanning where allowed. config WIFI_SCAN_PROFILE_5GHz_PASSIVE bool "Scan in the 5 GHz band using passive scan" + select WIFI_SCAN_TYPE_PASSIVE help Enable this profile to scan in the 5 GHz band using passive scanning on all channels. diff --git a/samples/scan_bm/src/main.c b/samples/scan_bm/src/main.c index 0f9cdc2..f1156aa 100644 --- a/samples/scan_bm/src/main.c +++ b/samples/scan_bm/src/main.c @@ -90,6 +90,15 @@ static int prepare_scan_params(struct nrf70_scan_params *params) } } + params->dwell_time_passive = CONFIG_WIFI_SCAN_DWELL_TIME_PASSIVE; + params->dwell_time_active = CONFIG_WIFI_SCAN_DWELL_TIME_ACTIVE; + + if (IS_ENABLED(CONFIG_WIFI_SCAN_TYPE_PASSIVE)) { + params->scan_type = NRF70_SCAN_TYPE_PASSIVE; + } else{ + params->scan_type = NRF70_SCAN_TYPE_ACTIVE; + } + return 0; }