ran*_*s26 3 ssid wifi android-wifi
我正在尝试制作一个可以创建可用wifi接入点列表的应用。这是我使用的部分代码:
x = new BroadcastReceiver()
{
@Override
public void onReceive(Context c, Intent intent)
{
results = wifi.getScanResults();
size = results.size();
if (results != null) {
for (int i=0; i<size; i++){
ScanResult scanresult = wifi.getScanResults().get(i);
String ssid = scanresult.SSID;
int rssi = scanresult.level;
String rssiString = String.valueOf(rssi);
textStatus.append(ssid + "," + rssiString);
textStatus.append("\n");
}
unregisterReceiver(x); //stops the continuous scan
textState.setText("Scanning complete!");
} else {
unregisterReceiver(x);
textState.setText("Nothing is found. Please make sure you are under any wifi coverage");
}
}
};
Run Code Online (Sandbox Code Playgroud)
textStatus和textState都是TextView。我可以使它工作,但有时结果在一次扫描中显示重复的SSID,但信号电平不同。可能会有3-4个相同的SSID,但信号电平不同。
SSID真的不同吗?它们有什么不同?谁能解释?
Are you having several router modems for the same network? For example: A company has a big wireless network with multiple router modems installed in several places so every room has Wifi. If you do that scan you will get a lot of results with the same SSIDs but with different acces points, and thus different signal level.
编辑:根据沃尔特(Walt)的评论,即使您的调制解调器是双频的,尽管只有一个接入点,您也可以有多个结果。
归档时间: |
|
查看次数: |
11928 次 |
最近记录: |