时有可能得到无线MAC地址,而无需实际连接到它?
可以说我有Android设备A。 我已经打开WiFi接口上,让自己的Android设备现在能够探测到附近的无线网络SSID广播。
最近我有几个无线网络的SSID广播,如下表所示:
SSID =炒作,MAC_ADDRESS = 00:39:E0:33:00 SSID =假,MAC_ADDRESS = 02:33:DF:39:89 SSID =桎,MAC_ADDRESS = D0:32:E8:97:29
如果没有实际连接到无线网络的SSID 比尔博
,我可以有它的MAC_ADDRESS?
请帮忙,谢谢。
解决方案 WifiManager wifiManager =(WifiManager)getSystemService(Context.WIFI_SERVICE);
registerReceiver(新BroadcastReceiver的(){
@覆盖
公共无效的onReceive(上下文C,意图意图)
{
名单< ScanResult>结果= wifiManager.getScanResults();
对于(ScanResult AP:结果){
Log.d(TAG,SSID =+ ap.SSID +陆委会=+ ap.BSSID);
}
}
},新的IntentFilter(WifiManager.SCAN_RESULTS_AVAILABLE_ACTION));
wifiManager.startScan();
对于BSS在基础设施模式下操作,BSSID是无线的MAC地址接入点(WAP)
Is it possible to get WiFi MAC Address without actually connected to it?
Lets say I have android device "A". I already turn on the WiFi interface, so that my android device is now able to detect nearby WiFi SSID broadcasted.
Nearby I have a few WiFi SSID broadcasted as listed below:
SSID=hype, MAC_ADDRESS=00:39:E0:33:00 SSID=dummy, MAC_ADDRESS=02:33:DF:39:89 SSID=bilbo, MAC_ADDRESS=D0:32:E8:97:29
Without actually connected to WiFi SSID bilbo
, can I have it's MAC_ADDRESS?
Please help, thanks.
解决方案WifiManager wifiManager = (WifiManager) getSystemService(Context.WIFI_SERVICE);
registerReceiver(new BroadcastReceiver() {
@Override
public void onReceive(Context c, Intent intent)
{
List<ScanResult> results = wifiManager.getScanResults();
for (ScanResult ap : results) {
Log.d(TAG, "SSID=" + ap.SSID + " MAC=" + ap.BSSID);
}
}
}, new IntentFilter(WifiManager.SCAN_RESULTS_AVAILABLE_ACTION));
wifiManager.startScan();
For a BSS operating in infrastructure mode, the BSSID is the MAC address of the wireless access point (WAP)
相关推荐
最新文章