From: Seonah Moon Date: Fri, 5 Aug 2016 04:54:29 +0000 (+0900) Subject: Apply SPRD featuring to WPS functions X-Git-Tag: accepted/tizen/common/20160805.130335^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F69%2F82669%2F2;p=platform%2Fcore%2Fconnectivity%2Fmobileap-agent.git Apply SPRD featuring to WPS functions Change-Id: I0383c01f84eada356113f2337aabcfafc36928cb Signed-off-by: Seonah Moon --- diff --git a/include/mobileap_softap.h b/include/mobileap_softap.h index d977156..d36551a 100755 --- a/include/mobileap_softap.h +++ b/include/mobileap_softap.h @@ -274,8 +274,10 @@ int _mh_core_enable_port_filtering(int enable); int _mh_core_add_port_filtering_rule(int port, const char *protocol, int allow); int _mh_core_add_custom_port_filtering_rule(int port1, int port2, const char *protocol, int allow); int _mh_core_set_vpn_passthrough_rule(int vpn_type, int enable); +#ifdef TIZEN_WLAN_BOARD_SPRD int _mh_core_push_wps_button(void); int _mh_core_set_wps_pin(const char *wps_pin); +#endif void _register_wifi_station_handler(void); void _unregister_wifi_station_handler(void); diff --git a/packaging/mobileap-agent.spec b/packaging/mobileap-agent.spec index 9a5510d..7c62604 100644 --- a/packaging/mobileap-agent.spec +++ b/packaging/mobileap-agent.spec @@ -1,6 +1,6 @@ Name: mobileap-agent Summary: Mobile AP daemon for setting tethering environments -Version: 1.0.67 +Version: 1.0.68 Release: 1 Group: System/Network License: Apache-2.0 diff --git a/src/mobileap_main.c b/src/mobileap_main.c index 3156e8f..1781869 100755 --- a/src/mobileap_main.c +++ b/src/mobileap_main.c @@ -401,7 +401,11 @@ gboolean tethering_push_wps_button(Tethering *obj, DBG("+"); +#ifdef TIZEN_WLAN_BOARD_SPRD ret = _mh_core_push_wps_button(); +#else + ret = MOBILE_AP_ERROR_NOT_PERMITTED; +#endif tethering_complete_push_wps_button(obj, context, ret); @@ -415,7 +419,11 @@ gboolean tethering_set_wps_pin(Tethering *obj, DBG("+"); +#ifdef TIZEN_WLAN_BOARD_SPRD ret = _mh_core_set_wps_pin(wps_pin); +#else + ret = MOBILE_AP_ERROR_NOT_PERMITTED; +#endif tethering_complete_set_wps_pin(obj, context, ret); diff --git a/src/mobileap_softap.c b/src/mobileap_softap.c index 7cc998c..19b0359 100755 --- a/src/mobileap_softap.c +++ b/src/mobileap_softap.c @@ -235,6 +235,7 @@ static int __execute_hostapd(const mobile_ap_type_e type, const char *ssid, return MOBILE_AP_ERROR_NONE; } +#ifdef TIZEN_WLAN_BOARD_SPRD static int __execute_hostapd_wps(const mobile_ap_type_e type, const char *ssid, const char *passphrase, const char *mode, int channel, int hide_mode, int mac_filter, int max_sta) { @@ -327,6 +328,7 @@ static int __execute_hostapd_wps(const mobile_ap_type_e type, const char *ssid, return MOBILE_AP_ERROR_NONE; } +#endif static int __terminate_hostapd() { @@ -958,10 +960,19 @@ int _mh_core_enable_softap(const mobile_ap_type_e type, const char *ssid, break; } - if (security != NULL && !strcmp(security, "wps")) - ret_status = __execute_hostapd_wps(type, ssid, key, mode, channel, hide_mode, mac_filter, max_sta); - else - ret_status = __execute_hostapd(type, ssid, security, key, mode, channel, hide_mode, mac_filter, max_sta); + if (security != NULL && !strcmp(security, "wps")) { +#ifdef TIZEN_WLAN_BOARD_SPRD + ret_status = __execute_hostapd_wps(type, ssid, key, + mode, channel, hide_mode, + mac_filter, max_sta); +#else + ret_status = MOBILE_AP_ERROR_NOT_PERMITTED; +#endif + } else { + ret_status = __execute_hostapd(type, ssid, security, key, + mode, channel, hide_mode, + mac_filter, max_sta); + } if (ret_status != MOBILE_AP_ERROR_NONE) { ERR("__execute_hostapd is failed\n"); @@ -1053,6 +1064,7 @@ int _mh_core_disable_softap(void) return ret_status; } +#ifdef TIZEN_WLAN_BOARD_SPRD int _mh_core_set_wps_pin(const char *wps_pin) { int ret = 0; @@ -1092,6 +1104,7 @@ int _mh_core_push_wps_button(void) return MOBILE_AP_ERROR_NONE; } +#endif static int __get_device_info_by_wext(softap_device_info_t *di) { diff --git a/src/mobileap_wifi.c b/src/mobileap_wifi.c index ba30f61..7cca4db 100755 --- a/src/mobileap_wifi.c +++ b/src/mobileap_wifi.c @@ -1471,7 +1471,12 @@ gboolean softap_set_wps_pin(Softap *obj, { mobile_ap_error_code_e ret = MOBILE_AP_ERROR_NONE; +#ifdef TIZEN_WLAN_BOARD_SPRD ret = _mh_core_set_wps_pin(wps_pin); +#else + ret = MOBILE_AP_ERROR_NOT_PERMITTED; +#endif + softap_complete_set_wps_pin(obj, context, ret); return TRUE; @@ -1481,7 +1486,12 @@ gboolean softap_push_wps_button(Softap *obj, GDBusMethodInvocation *context) { mobile_ap_error_code_e ret = MOBILE_AP_ERROR_NONE; +#ifdef TIZEN_WLAN_BOARD_SPRD ret = _mh_core_push_wps_button(); +#else + ret = MOBILE_AP_ERROR_NOT_PERMITTED; +#endif + softap_complete_push_wps_button(obj, context, ret); return TRUE;