android 看AP 国家代码,Android WiFi 获取国家码
記錄一下Android獲取國家碼的方式
Wifi 國家碼獲取途徑
1.DefaultCountryTablefield in WCNSS_qcom_wlan_nv.bin-read during driver initialization
nv中默認有設(shè)置國家碼
2.gStaCountryCodeparameter in WCNSS_qcom_cfg.ini –read during driver initialization to replace default country code in WCNSS_qcom_wlan_nv.bin
配置文件gStaCountryCodeparameter設(shè)置國家碼,用于覆蓋nv中的國家碼
3.Country IE from AP defined by 802.11d –information given by AP
使能802.11d功能,通過AP來獲取國家碼,g11dSupportEnabled用來打開這個功能。
4.“iw reg set” command –set from userspaceapplication over cfg80211 interface
用戶空間通過命令設(shè)置國家碼
5.Private IOCTL with “COUNTRY” command –set from userspaceapplication over wextinterface
用戶空間通過ioctl設(shè)置國家碼,例如wpa_cli -iwlan DRIVER COUNTRY US.
gCountryCodePriority設(shè)置國家碼獲取的優(yōu)先級
1 –Country Code information from userspacecommands takes priority
userspacecommands > 802.11d > gStaCountryCodein WCNSS_qcom_cfg.ini > DefaultCountryTablein WCNSS_qcom_wlan_nv.bin
默認是0:
0 –Country Code information from 802.11d takes priority
802.11d > userspacecommands > gStaCountryCodein WCNSS_qcom_cfg.ini > DefaultCountryTablein WCNSS_qcom_wlan_nv.bin
通過AP獲取國家碼:
g11dSupportEnabled=1使能,然后如果周圍有多個AP,包含不同的國家碼,根據(jù)接收到的Beacon幀(被動掃描),進行投票,設(shè)置成票數(shù)最多的國家碼。
但是我查看的話,好多情況下,只是更具了解的AP來設(shè)置國家碼。
gEnableBypass11d=1,會進行主動掃描,獲取國家碼,這樣速率會快些。
通過SIM卡獲取國家碼是最可靠的途徑。
LiuTao
2018-11-15
總結(jié)
以上是生活随笔為你收集整理的android 看AP 国家代码,Android WiFi 获取国家码的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: android getview方法,an
- 下一篇: android fragment传递数据