Windows phone get WiFi BSSID

Source: Internet
Author: User
Tags 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.

      stringGetlanidentifierdata (Lanidentifier lanidentifier) {stringLanidentifierdata =string.          Empty; if(Lanidentifier = =NULL)          {              returnLanidentifierdata; }          if(Lanidentifier.infrastructureid! =NULL) {Lanidentifierdata+="Infrastructure Type:"+ LanIdentifier.InfrastructureId.Type +"\ n"; Lanidentifierdata+="Infrastructure Value:"; varInfrastructureidvalue =LanIdentifier.InfrastructureId.Value; foreach(varValueinchinfrastructureidvalue) {Lanidentifierdata+ = value +" "; }          }          if(Lanidentifier.portid! =NULL) {Lanidentifierdata+="\nport Type:"+ LanIdentifier.PortId.Type +"\ n"; Lanidentifierdata+="Port Value:"; varPortidvalue =LanIdentifier.PortId.Value; foreach(varValueinchportidvalue) {Lanidentifierdata+ = value +" "; }          }          if(Lanidentifier.networkadapterid! =NULL) {Lanidentifierdata+="\nnetwork Adapter Id:"+ Lanidentifier.networkadapterid +"\ n"; }          returnLanidentifierdata; }

One of the LanIdentifier.InfrastructureId.Value is BSSID, which needs to be taken out and converted into 16.

 for (int0; i < lanIdentifier.InfrastructureId.Value.Count; i++)
+ = 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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.