Enumerating Wifi access points on Windows Mobile
The other day, I wanted to get the list of all the nearby wireless access points in C++ on a Windows Mobile 6 terminal. After a few hours spent digging on Google, I realized that was trickier that it seemed and not as easy as on other platforms.
Here is what I had to do:
- Enumerate all network adapters with
GetAdaptersInfo(), - For each adapter, consider only the ones with a
MIB_IF_TYPE_ETHERNETtype, - Open the NDIS device (
UIO1:) and issue aIOCTL_NDISUIO_NIC_STATISTICSioctl on it, in order to get the physical medium type of the adapter, and consider anly those with aNdisPhysicalMediumWirelessLanmedium, - Each time I want to initiate a scan, issue
OID_802_11_BSSID_LIST_SCANandOID_802_11_BSSID_LIST_SCANioctls on theUIO1:device.
Here is the code, packaged into a CWifi class:
Leave a Comment