小米4 hostapd配置热点

hostapd

adb shell:
hostapd -i wlan0 /data/misc/wifi/hostapd.conf

配置ip地址
ifconfig wlan0 192.168.2.15 up

hw_mode表示采用哪种协议模式,其中a = IEEE 802.11a支持5.0Ghz,默认g = IEEE 802.11g 2.4G频段
#Operation mode (a = IEEE 802.11a, b = IEEE 802.11b, g = IEEE 802.11g,
#n = IEEE 802.11n, g_only = IEEE 802.11g_only, n_only = IEEE 802.11n_only,
#Default: IEEE 802.11n
hw_mode=a

netd

ndc命令可以配置热点模式,
netd中根据channel个数决定采用IEEE 802.11a还是IEEE 802.11g
std::string wbuf(StringPrintf(“interface=%s\n”
“driver=nl80211\n”
“ctrl_interface=/data/misc/wifi/hostapd\n”
“ssid=%s\n”
“channel=%d\n”
“ieee80211n=1\n”
“hw_mode=%c\n”
“ignore_broadcast_ssid=%d\n”
“wowlan_triggers=any\n”,
argv[2], argv[3], channel, (channel <= 14) ? ‘g’ : ‘a’, hidden));

你可能感兴趣的:(android)