channels and MAC addresses of scanned wireless networks
-
Tuesday, July 29, 2008 9:15 AMHi everybody!
I'm using the Native WiFi API in Vista to scan for Networks and connect to them.
For detailed information I'd like to tell the user the channel and MAC address (BSSID) of each network that was found.
Unfortunately the WLAN_AVAILABLE_NETWORK struct does not carry this information, and there seems to be no other function than WlanGetAvailableNetworkList() to receive scanned network data.
Does anyone know if and where I may get the channels and BSSIDs of the available networks?
Thanks
Andreas
Answers
-
Tuesday, August 05, 2008 9:23 AM
I found the solution by myself. So I anyone is interested:
You have to call WlanGetNetworkBssList() for every SSID that has been found by WlanGetAvailableNetworkList().
Unfortunately this function is only available unter Vista.
All Replies
-
Tuesday, August 05, 2008 9:23 AM
I found the solution by myself. So I anyone is interested:
You have to call WlanGetNetworkBssList() for every SSID that has been found by WlanGetAvailableNetworkList().
Unfortunately this function is only available unter Vista. -
Monday, February 16, 2009 7:34 PMWe're trying to obtain the BSSID of a wireless network, too. We have not been as lucky as you in figuring out the solution. Did you do this in Visual C++ 2008, if so can you post it in the forum? My group could really use your help. Thank you.
DNH -
Sunday, February 22, 2009 7:40 PM
I'll give you a short snippet that will show you how to do it in principle:#include <wlanapi.h> #include <objbase.h> [...] HANDLE WlanApiSession; DWORD WlanApiVersion, Counter1, Counter2; WLAN_AVAILABLE_NETWORK_LIST *WlanNetworkList; WLAN_BSS_LIST *WlanBssList; WlanOpenHandle(2, NULL, &WlanApiVersion, &WlanApiSession); WlanScan(WlanApiSession, &IfGuid, NULL, NULL, NULL); //IfGuid is a GUID and contains the WLAN adapter identifier WlanGetAvailableNetworkList(WlanApiSession, &IfGuid, 0, NULL, (void **)&WlanNetworkList); if ((WlanNetworkList != NULL) && (WlanNetworkList->dwNumberOfItems > 0)) { for (Counter1 = 0; Counter1 < WlanNetworkList->dwNumberOfItems; Counter1++) { [...] WlanGetNetworkBssList(WlanApiSession, &IfGuid, (void *)(&WlanNetworkList->Network[Counter1].dot11Ssid), WlanNetworkList->Network[Counter1].dot11BssType, WlanNetworkList->Network[Counter1].bSecurityEnabled, NULL, (void **)&WlanBssList); //WlanBssList->wlanBssEntries[n].dot11Bssid are the BSSIDs of the WLAN network (with n=0...x for x+1 visible APs in this network (could be more than 1 -> roaming) WlanFreeMemory(WlanBssList); [...] Counter1++; } } WlanFreeMemory(WlanNetworkList); WlanCloseHandle(WlanApiSession, NULL);