Continuous Wi-Fi Scanning (and returning results in real time)

I have been experimenting with the Wi-Fi Scan sample on the nrf7002dk. The way the sample is programmed, it performs a scan for 1 second, and prints the results to the serial terminal after the 1 second scan has finished.

I would like to scan continuously (similar to a sniffer), but be able to receive and print the scanned results as they come in.

I attempted to put the call to wifi_scan() in a forever loop, which results in a semi-continuous scan, but has long pauses between every loop.

How can I modify the Wi-Fi Scan sample to do a fully continuous, indefinite, scan?

Related