Apply SPRD featuring to WPS functions 69/82669/2 accepted/tizen/common/20160805.130335 accepted/tizen/ivi/20160809.011152 accepted/tizen/mobile/20160809.011048 accepted/tizen/tv/20160809.011104 accepted/tizen/wearable/20160809.011124 submit/tizen/20160805.060940
authorSeonah Moon <seonah1.moon@samsung.com>
Fri, 5 Aug 2016 04:54:29 +0000 (13:54 +0900)
committerSeonah Moon <seonah1.moon@samsung.com>
Fri, 5 Aug 2016 04:56:28 +0000 (13:56 +0900)
Change-Id: I0383c01f84eada356113f2337aabcfafc36928cb
Signed-off-by: Seonah Moon <seonah1.moon@samsung.com>
include/mobileap_softap.h
packaging/mobileap-agent.spec
src/mobileap_main.c
src/mobileap_softap.c
src/mobileap_wifi.c

index d977156..d36551a 100755 (executable)
@@ -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);
index 9a5510d..7c62604 100644 (file)
@@ -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
index 3156e8f..1781869 100755 (executable)
@@ -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);
 
index 7cc998c..19b0359 100755 (executable)
@@ -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)
 {
index ba30f61..7cca4db 100755 (executable)
@@ -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;