I'm currently developing a windows application which detects WiFi network changes every 10 to 15 seconds. There is no problem with detecting new mobile hotspots (updates were reflected after at least 20 or 30 seconds). However, there is a problem when a mobile hotspot is turned off as it disappears in the _WLAN_BSS_LIST after at least 90 to 120 seconds.
I used WlanScan and WlanGetAvailableNetworkList to retrieve the updated list of WiFi networks. I even used WlanRegisterNotification to notify changes thru callback. However, same behavior exists. It seems that the cache list of WiFi networks has issues when a mobile hotspot is turned off.
I also tried checking the following but behavior is still the same.
Refresh WiFi network list with 'WlanScan' (convert api syntax from c# to vba... or a workaround?)
I'm using Kotlin multiplatform to develop the application.
I'm also using the following:
I read something interesting in the Microsoft documentation (https://learn.microsoft.com/en-us/windows/win32/api/wlanapi/nf-wlanapi-wlanscan ):
The Wireless LAN Service does not send notifications when available wireless networks change. The Wireless LAN Service does not track changes to the list of available networks across multiple scans. The current default behavior is that the Wireless LAN Service only asks the wireless interface driver to scan for wireless networks every 60 seconds, and in some cases (when already connected to wireless network) the Wireless LAN Service does not ask for scans at all
Does this mean that even when I call WlanScan and WlanGetAvailableNetworkList functions to retrieve the list of networks, I would still not able to get updated list since scan is performed every 60 seconds?
So my question - Is my expectation correct that we can retrieve an updated list of WiFi network list if we call the said functions accordingly as soon as possible? If yes, what are the ways to do it?
Thank you!!