[wfd-manager]: Added support of "RemoveAllNetworks" Method 19/69419/2
authorManeesh Jain <maneesh.jain@samsung.com>
Fri, 13 May 2016 06:15:12 +0000 (11:45 +0530)
committerManeesh Jain <maneesh.jain@samsung.com>
Fri, 13 May 2016 06:16:59 +0000 (23:16 -0700)
Description: This method is used to Remove all configured networks
     in supplicant

Change-Id: I9de372b001e52f5a746f08c680296f7e48efe053
Signed-off-by: Maneesh Jain <maneesh.jain@samsung.com>
oem/wifi-direct-oem.h
plugin/wpasupplicant/ctrl_iface_dbus/include/wfd-plugin-wpasupplicant.h
plugin/wpasupplicant/ctrl_iface_dbus/wfd-plugin-wpasupplicant.c
plugin/wpasupplicant/ctrl_iface_sock/include/wfd-plugin-wpasupplicant.h
plugin/wpasupplicant/ctrl_iface_sock/wfd-plugin-wpasupplicant.c
plugin/wpasupplicant/emul/include/wfd-plugin-wpasupplicant.h
plugin/wpasupplicant/emul/wfd-plugin-wpasupplicant-emul.c

index c8ab33c..6d7006c 100755 (executable)
@@ -498,6 +498,7 @@ typedef struct _wfd_oem_ops_s {
        int (*refresh) (void);
        int (*save_config) (void);
        int (*set_operating_channel)(int channel);
+       int (*remove_all_network)(void);
 
 
 } wfd_oem_ops_s;
index bf2c129..7a3fd3a 100755 (executable)
@@ -442,6 +442,7 @@ int ws_set_display(wfd_oem_display_s *wifi_display);
 int ws_refresh();
 int ws_save_config(void);
 int ws_set_operating_channel(int channel);
+int ws_remove_all_network(void);
 
 
 #endif /* __WFD_PLUGIN_WPASUPPLICANT_H__ */
index dae7e8d..b764dc0 100755 (executable)
@@ -129,6 +129,7 @@ static wfd_oem_ops_s supplicant_ops = {
        .refresh = ws_refresh,
        .save_config =  ws_save_config,
        .set_operating_channel = ws_set_operating_channel,
+       .remove_all_network = ws_remove_all_network,
 
        };
 
@@ -5307,3 +5308,32 @@ int ws_set_operating_channel(int channel)
        return res;
 }
 
+int ws_remove_all_network(void)
+{
+       __WDP_LOG_FUNC_ENTER__;
+       GDBusConnection *g_dbus = NULL;
+       dbus_method_param_s params;
+       int res = 0;
+
+       g_dbus = g_pd->g_dbus;
+       if (!g_dbus) {
+               WDP_LOGE("DBus connection is NULL");
+               __WDP_LOG_FUNC_EXIT__;
+               return -1;
+       }
+       memset(&params, 0x0, sizeof(dbus_method_param_s));
+
+       dbus_set_method_param(&params, "RemoveAllNetworks", g_pd->iface_path, g_dbus);
+       params.params = NULL;
+
+       res = dbus_method_call(&params, SUPPLICANT_IFACE, NULL, NULL);
+       if (res < 0)
+               WDP_LOGE("Failed to send [RemoveAllNetworks] command to wpa_supplicant");
+       else
+               WDP_LOGD("Succeeded to remove all networks from supplicant");
+
+       WDP_LOGD("Succeeded to remove all network");
+       __WDP_LOG_FUNC_EXIT__;
+       return res;
+}
+
index 4613696..7fa9914 100755 (executable)
@@ -581,5 +581,6 @@ int ws_set_display(wfd_oem_display_s *wifi_display);
 int ws_refresh();
 int ws_save_config(void);
 int ws_set_operating_channel(int channel);
+int ws_remove_all_network(void);
 
 #endif /* __WFD_PLUGIN_WPASUPPLICANT_H__ */
index 0358b38..46dc249 100755 (executable)
@@ -272,6 +272,7 @@ static wfd_oem_ops_s supplicant_ops = {
        .refresh = ws_refresh,
        .save_config = ws_save_config,
        .set_operating_channel = ws_set_operating_channel,
+       .remove_all_network = ws_remove_all_network,
 
        };
 
@@ -4905,3 +4906,12 @@ int ws_set_operating_channel(int channel)
        __WDP_LOG_FUNC_EXIT__;
        return 0;
 }
+
+int ws_remove_all_network()
+{
+       __WDP_LOG_FUNC_ENTER__;
+
+       __WDP_LOG_FUNC_EXIT__;
+       return 0;
+}
+
index 3749114..9de97fd 100755 (executable)
@@ -120,5 +120,7 @@ int ws_set_display(wfd_oem_display_s *wifi_display);
 int ws_refresh();
 int ws_save_config(void);
 int ws_set_operating_channel(int channel);
+int ws_remove_all_network(void);
+
 
 #endif /* __WFD_PLUGIN_WPASUPPLICANT_H__ */
index c88101b..c686239 100755 (executable)
@@ -70,6 +70,7 @@ static wfd_oem_ops_s supplicant_ops = {
 #endif /* TIZEN_FEATURE_WIFI_DISPLAY */
        .save_config = ws_save_config,
        .set_operating_channel = ws_set_operating_channel,
+       .remove_all_network = ws_remove_all_network,
 
        };
 
@@ -455,3 +456,11 @@ int ws_set_operating_channel(int channel)
        return -1;
 }
 
+int ws_remove_all_network()
+{
+       __WDP_LOG_FUNC_ENTER__;
+
+       __WDP_LOG_FUNC_EXIT__;
+       return -1;
+}
+