Original: Windows phone get WiFi BSSID
BSSID, a special Ad-hoc LAN application, also known as basic Service set (BSS), a group of computers that set the same BSS name can be self-formed. Each BSS is given a bssid, which is a 48-bit binary identifier used to identify different BSS. Its main advantage is that it can be used as a filter.
BSSID refers to the MAC address of the site, (STA) in an access point, (AP) in an infrastructure mode, and BSS is defined by the IEEE 802.11-1999 Wireless LAN specification. Each BSS is uniquely defined in this area. In a IBSS, BSSID is a locally administered IEEE MAC address that is generated from an arbitrary 46-bit encoding. The individual/group bit of the address is set to 0. The universal/local address bit is set to 1.
The above words from Baidu Encyclopedia.
It was developed in order to get the MAC address of the hotspot that the phone is connected to, so it has been the API or method to find the WiFi MAC address, but it didn't succeed.
Lanidentifier Class
The location data can be represented as BSSID (if the network adapter media type is wireless LAN), or not for tuple <chassisid, Port number> (if the network adapter type is Ethernet). Data is represented according to the LLDP protocol.
For an example of how to retrieve the data represented by the lanidentifier object, see how to retrieve network adapters and location information.
Just stick to the code.
string GetLanIdentifierData(LanIdentifier lanIdentifier)
{
string lanIdentifierData = string.Empty;
if (lanIdentifier == null)
{
return lanIdentifierData;
}
if (lanIdentifier.InfrastructureId != null)
{
lanIdentifierData += "Infrastructure Type: " + lanIdentifier.InfrastructureId.Type + "\n";
lanIdentifierData += "Infrastructure Value: ";
var infrastructureIdValue = lanIdentifier.InfrastructureId.Value;
foreach (var value in infrastructureIdValue)
{
lanIdentifierData += value + " ";
}
}
if (lanIdentifier.PortId != null)
{
lanIdentifierData += "\nPort Type : " + lanIdentifier.PortId.Type + "\n";
lanIdentifierData += "Port Value: ";
var portIdValue = lanIdentifier.PortId.Value;
foreach (var value in portIdValue)
{
lanIdentifierData += value + " ";
}
}
if (lanIdentifier.NetworkAdapterId != null)
{
lanIdentifierData += "\nNetwork Adapter Id : " + lanIdentifier.NetworkAdapterId + "\n";
}
return lanIdentifierData;
}
One of the LanIdentifier.InfrastructureId.Value is BSSID, which needs to be taken out and converted into 16.
for (int i = 0; i < lanIdentifier.InfrastructureId.Value.Count; i++)
{
lanIdentifierData += lanIdentifier.InfrastructureId.Value[i].ToString("X2");
}
This is bssid, at least the value I get is the same as the value the iphone gets.
In addition,ireadonlylist<lanidentifier> lanidentifiers = Networkinformation.getlanidentifiers (); Windows 8 is also supported.
Hope to help you.
Windows phone get WiFi BSSID