[wfd-manager]: Add support of new method called "SaveConfig" 92/69292/2
authorManeesh Jain <maneesh.jain@samsung.com>
Thu, 12 May 2016 11:40:48 +0000 (17:10 +0530)
committerManeesh Jain <maneesh.jain@samsung.com>
Thu, 12 May 2016 11:45:11 +0000 (04:45 -0700)
Description: "SaveConfig" method is used to save configuration to
supplicant configuration file.

Change-Id: Icf6652126b935c8ce1b662a7f40bef96f7a92f50
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 [changed mode: 0644->0755]

index ab5a409..4e2f21f 100755 (executable)
@@ -496,6 +496,8 @@ typedef struct _wfd_oem_ops_s {
 #endif /* TIZEN_FEATURE_WIFI_DISPLAY */
 
        int (*refresh) (void);
+       int (*save_config) (void);
+
 
 } wfd_oem_ops_s;
 
index 6bcec4b..d2d0cc5 100755 (executable)
@@ -440,5 +440,7 @@ int ws_set_display(wfd_oem_display_s *wifi_display);
 #endif /* TIZEN_FEATURE_WIFI_DISPLAY */
 
 int ws_refresh();
+int ws_save_config(void);
+
 
 #endif /* __WFD_PLUGIN_WPASUPPLICANT_H__ */
index dfae789..d4be700 100755 (executable)
@@ -127,6 +127,7 @@ static wfd_oem_ops_s supplicant_ops = {
 #endif /* TIZEN_FEATURE_WIFI_DISPLAY */
 
        .refresh = ws_refresh,
+       .save_config =  ws_save_config,
 
        };
 
@@ -5231,3 +5232,32 @@ int ws_refresh()
        __WDP_LOG_FUNC_EXIT__;
        return 0;
 }
+
+int ws_save_config(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, "SaveConfig", 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 save config to wpa_supplicant");
+       else
+               WDP_LOGD("Succeeded to save config");
+
+       __WDP_LOG_FUNC_EXIT__;
+       return res;
+}
+
index 2efb934..25890ff 100755 (executable)
@@ -579,5 +579,6 @@ int ws_set_display(wfd_oem_display_s *wifi_display);
 #endif /* TIZEN_FEATURE_WIFI_DISPLAY */
 
 int ws_refresh();
+int ws_save_config(void);
 
 #endif /* __WFD_PLUGIN_WPASUPPLICANT_H__ */
index fedbda5..484a7e8 100755 (executable)
@@ -270,6 +270,7 @@ static wfd_oem_ops_s supplicant_ops = {
 #endif /* TIZEN_FEATURE_WIFI_DISPLAY */
 
        .refresh = ws_refresh,
+       .save_config = ws_save_config,
 
        };
 
@@ -4861,3 +4862,12 @@ int ws_refresh()
        __WDP_LOG_FUNC_EXIT__;
        return 0;
 }
+
+int ws_save_config()
+{
+       __WDP_LOG_FUNC_ENTER__;
+
+       __WDP_LOG_FUNC_EXIT__;
+       return 0;
+}
+
index 053141b..9a1de67 100755 (executable)
@@ -118,5 +118,6 @@ int ws_set_display(wfd_oem_display_s *wifi_display);
 #endif /* TIZEN_FEATURE_WIFI_DISPLAY */
 
 int ws_refresh();
+int ws_save_config(void);
 
 #endif /* __WFD_PLUGIN_WPASUPPLICANT_H__ */
old mode 100644 (file)
new mode 100755 (executable)
index 79a8fdc..b841baa
@@ -68,6 +68,8 @@ static wfd_oem_ops_s supplicant_ops = {
        .miracast_init = ws_miracast_init,
        .set_display = ws_set_display,
 #endif /* TIZEN_FEATURE_WIFI_DISPLAY */
+       .save_config = ws_save_config,
+
        };
 
 int wfd_plugin_load(wfd_oem_ops_s **ops)
@@ -433,4 +435,13 @@ int ws_set_display(wfd_oem_display_s *wifi_display)
        __WDP_LOG_FUNC_EXIT__;
        return -1;
 }
+
+int ws_save_config(void)
+{
+       __WDP_LOG_FUNC_ENTER__;
+
+       __WDP_LOG_FUNC_EXIT__;
+       return -1;
+}
+
 #endif /* TIZEN_FEATURE_WIFI_DISPLAY */