1.WifiInfo 源码:
int mFrequency=wifiInfo.getFrequency();
/**
* @hide
* TODO: makes real freq boundaries
*/
public boolean is24GHz() {
return ScanResult.is24GHz(mFrequency);
}
/**
* @hide
* TODO: makes real freq boundaries
*/
public boolean is5GHz() {
return ScanResult.is5GHz(mFrequency);
}
2. ScanResult 代码
public static boolean is24GHz(int freq) {
return freq > 2400 && freq < 2500;
}
/**
* @hide
* TODO: makes real freq boundaries
*/
public static boolean is5GHz(int freq) {
return freq > 4900 && freq < 5900;
}