Retrieve MAC of all access points available

Nov 15, 2007 at 4:09 AM
It is possible to get all mac addresses of all available networks ?

regards.
Jan 30, 2008 at 11:37 AM
I agree with cbrotas, it will be perfect if this piece of code can also get all mac addresses of all available networks.
Jan 30, 2008 at 1:39 PM
use native wifi library (microsoft) to get that information and also more information about all available ap's.
Jan 31, 2008 at 7:19 AM
First i want to thank with qucik replies. Yes i have a look on the native wifi library of windows but when i am trying to use public Wlan.WlanBssEntry[] GetNetworkBssList() method of this API, i get a "The request not supported" exception in the Wlan.WlanGetNetworkBssList row. In many forums it is declared that this action is supported for Windows vista platform?

First question is, am i using the right method to find Mac's of ap's? And the second is, using vista will resolve my problem?
Jan 31, 2008 at 12:05 PM
you welcome.

you right about vista, but that method work in windows XP professional with service pack 2 and KB918997 update, some time you need also msxml6.msi.

this and example to use native wifi and get all ap's info.

/// Wlan API client.
/// </summary>
private WlanClient wlanClient;
/// <summary>
/// Wireless interface.
/// </summary>
private WlanClient.WlanInterface wlanInterface;
/// <summary>
/// Wireless interface list.
/// </summary>
private WlanClient.WlanInterface[] wlanInterfaces;
/// <summary>
/// Available networks lists.
/// </summary>
private Wlan.WlanAvailableNetwork[] availableNets;
/// <summary>
/// Access Point list.
/// </summary>
private ArrayList aps;


/// <summary>
/// Search for available access points.
/// </summary>
public void scanAps()
{
if (wlanInterfaces.Length != 0)
{
wlanInterface.Scan();
availableNets = wlanInterface.GetAvailableNetworkList(
Wlan.WlanGetAvailableNetworkFlags.IncludeAllAdhocProfiles);

updateAPsList();
}
}


/// <summary>
/// Get access point recieved signal.
/// </summary>
/// <param name="index">AP index in array</param>
/// <returns>Recieved Signal</returns>
private int getApRS(int index)
{
return (int)availableNetsindex.wlanSignalQuality;
}

/// <summary>
/// Add new access points to array list, and update
/// recieved signal in old access points in the array.
/// </summary>
private void updateAPsList()
{
if (aps.Count == 0)
{
for (int i = 0; i < availableNets.Length; i++)
{
addAP(i);
}
}
else
{
foreach (AP ap in aps)
{
ap.RS = 0;
}
for (int i = 0; i < availableNets.Length; i++)
{
bool newAP = true;

foreach (AP ap in aps)
{
if (ap.SSID.Equals(getApSSID(i)))
{
updateAPRS(i);
newAP = false;
}
}
if (newAP)
{
addAP(i);
}
}
}

}
Oct 3, 2008 at 10:01 AM
Is anybody successful in gettung mac address for all the networks in XP using GetNetworkBssList API. I am getting not supported error. I have MSXML6 and latest KB is installed in XP to make it compatible to run wireless API's. Is there any other way to get the mac address in for all the wireless networks?