What is the proper way to force passive Wi-Fi scans with the nRF7000 on nRF Connect SDK v2.3.0?

Nordic Team:

We have a product in production that uses the nRF9160 and nRF7000 and had assumed the nRF7000 did not transmit.  We only recently discovered that it does, in fact, transmit, unless it is explicitly told to do passive scans.

This project is already in production and is using nRF Connect SDK v2.3.0.  We'd like to change as little as possible but switch the scans to passive.  According to this postnRF Connect SDK v2.3.0 did not have that ability.  It is indeed missing the CONFIG_NRF70_PASSIVE_SCAN_ONLY configuration option, and the wifi_scan_type enum.

/** @brief Wi-Fi scanning types. */
enum wifi_scan_type {
	/** Active scanning (default). */
	WIFI_SCAN_TYPE_ACTIVE = 0,
	/** Passive scanning. */
	WIFI_SCAN_TYPE_PASSIVE,
};

To keep changes minimal, and avoid changing the nRF Connect SDK version, we added this to the top of main():

void main(void)
{
	const struct device* wifi_dev = device_get_binding("wlan0");
	struct wifi_nrf_vif_ctx_zep* wifi_data = wifi_dev->data;
	wifi_data->passive_scan = true;
	...

This appears to make scans passive (we measured), and it looks to be how the wifi_util shell command does it.  See nrf_wifi_util_set_passive_scan() here.

But it still seems like a bit of a hack to add a feature that did not exist in this SDK version.  Do you think this is a suitable patch to achieve passive scans, or will this cause problems for us down the road?

Any advice you have would be appreciated.

Parents Reply Children
No Data
Related