ways for a client to identify the specific access point it is connected to within a single SSID?

霸气de小男生 提交于 2019-12-09 23:52:28

问题


The problem is as follows - there's a university campus wide wifi connection with a single SSID, say "campus-wifi". The user freely roams around campus, and the usual hand-off between access points occurs. My question is, is there any information at any layer of the network stack that allows the client to identify (any unique identifier is fine) the specific access point they're connected to, rather than simply the fact that they are connected to "campus-wifi"?

If it's relevant, I'd like to be able to do this from mobile devices (android/iOS primarily).


回答1:


You can get the BSSID of the access point you are connected to. Something like:

WifiManager wifi = (WifiManager) getSystemService(Context.WIFI_SERVICE);
WifiInfo info = wifi.getConnectionInfo();
String BSSID = info.getBSSID();

Not 100% what you'll get back with the BSSID since I've never used it -- but it should uniquely ID the base station -- Wikipedia seems to indicate that you'll get the MAC of the AP (near the bottom):

http://en.wikipedia.org/wiki/Service_set_(802.11_network)#Basic_service_set_identifier_.28BSSID.29

-- Dan


EDIT:

According to the Android docs, it is the MAC address:

http://developer.android.com/reference/android/net/wifi/WifiInfo.html



来源:https://stackoverflow.com/questions/5629665/ways-for-a-client-to-identify-the-specific-access-point-it-is-connected-to-withi

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!