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_ETHERNET
type, - Open the NDIS device (
UIO1:
) and issue aIOCTL_NDISUIO_NIC_STATISTICS
ioctl on it, in order to get the physical medium type of the adapter, and consider anly those with aNdisPhysicalMediumWirelessLan
medium, - Each time I want to initiate a scan, issue
OID_802_11_BSSID_LIST_SCAN
andOID_802_11_BSSID_LIST_SCAN
ioctls on theUIO1:
device.
Here is the code, packaged into a CWifi
class:
Leave a Comment