From: Dmitry Shmidt Date: Tue, 6 Jan 2015 21:41:50 +0000 (-0800) Subject: server: softap: Set hw_mode according to selected channel X-Git-Tag: android-x86-7.1-r1~154 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=237f0a5bea8abdd245671c69b8e3c33e149d3f44;p=android-x86%2Fsystem-netd.git server: softap: Set hw_mode according to selected channel Change-Id: If3d12d33e857b1438edd504ddbd5e5504673725c Signed-off-by: Dmitry Shmidt --- diff --git a/server/SoftapController.cpp b/server/SoftapController.cpp index 270bd51..853ca8f 100644 --- a/server/SoftapController.cpp +++ b/server/SoftapController.cpp @@ -141,8 +141,8 @@ int SoftapController::setSoftap(int argc, char *argv[]) { asprintf(&wbuf, "interface=%s\ndriver=nl80211\nctrl_interface=" "/data/misc/wifi/hostapd\nssid=%s\nchannel=%d\nieee80211n=1\n" - "hw_mode=g\nignore_broadcast_ssid=%d\nwowlan_triggers=any\n", - argv[2], argv[3], channel, hidden); + "hw_mode=%c\nignore_broadcast_ssid=%d\nwowlan_triggers=any\n", + argv[2], argv[3], channel, (channel <= 14) ? 'g' : 'a', hidden); if (argc > 7) { if (!strcmp(argv[6], "wpa-psk")) {