From: Nishant Chaprana Date: Mon, 14 Mar 2016 07:01:06 +0000 (+0530) Subject: Removed "LaunchDirect" call to net-config from wifi_direct_initialize X-Git-Tag: submit/tizen/20160316.022156^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c1cb06baba7df13c73db80154d7b00d7b9748823;p=platform%2Fcore%2Fapi%2Fwifi-direct.git Removed "LaunchDirect" call to net-config from wifi_direct_initialize now wfd-manager starts with dbus auto activation logic, So launching wfd-manager from net-config is not required anymore. Also using this code with dbus auto activation leads to conditions where two wfd-manager instances are running. Change-Id: I5660fb454302b3955e87ee90244f5d6e7da67e7a Signed-off-by: Nishant Chaprana --- diff --git a/packaging/capi-network-wifi-direct.spec b/packaging/capi-network-wifi-direct.spec index 3f7f456..b0a2f99 100644 --- a/packaging/capi-network-wifi-direct.spec +++ b/packaging/capi-network-wifi-direct.spec @@ -1,6 +1,6 @@ Name: capi-network-wifi-direct Summary: Network WiFi-Direct Library -Version: 1.2.51 +Version: 1.2.52 Release: 1 Group: Network & Connectivity/API License: Apache-2.0 diff --git a/src/include/wifi-direct-client-proxy.h b/src/include/wifi-direct-client-proxy.h index 66b6dd9..b5dccfc 100755 --- a/src/include/wifi-direct-client-proxy.h +++ b/src/include/wifi-direct-client-proxy.h @@ -25,12 +25,6 @@ #include #include "wifi-direct.h" -#define NETCONFIG_SERVICE "net.netconfig" -#define NETCONFIG_WIFI_INTERFACE "net.netconfig.wifi" -#define NETCONFIG_WIFI_PATH "/net/netconfig/wifi" -#define NETCONFIG_WIFI_LAUNCHDIRECT "LaunchDirect" -#define DBUS_REPLY_TIMEOUT (120 * 1000) - #define SOCK_FD_MIN 3 #define WIFI_DIRECT_WPA_LEN 64 #define MACSTR_LEN 18 diff --git a/src/include/wifi-direct-dbus.h b/src/include/wifi-direct-dbus.h index 4713a2c..a2ac299 100644 --- a/src/include/wifi-direct-dbus.h +++ b/src/include/wifi-direct-dbus.h @@ -75,4 +75,4 @@ int wifi_direct_dbus_unpack_ay(unsigned char *dst, GVariant *src, int size); } #endif -#endif /* __NETCONFIG_NETDBUS_H__ */ +#endif /* __WIFI_DIRECT_DBUS_H__ */ diff --git a/src/wifi-direct-client-proxy.c b/src/wifi-direct-client-proxy.c index 9bc95db..026ecc4 100755 --- a/src/wifi-direct-client-proxy.c +++ b/src/wifi-direct-client-proxy.c @@ -563,49 +563,6 @@ void __wfd_client_print_persistent_group_info(wfd_persistent_group_info_s *list, WDC_LOGD("------------------------------------------\n"); } -static int __wfd_client_launch_server_dbus(void) -{ - GDBusConnection *netconfig_bus = NULL; - GError *g_error = NULL; - -#if !GLIB_CHECK_VERSION(2,36,0) - g_type_init(); -#endif - netconfig_bus = g_bus_get_sync(G_BUS_TYPE_SYSTEM, NULL, &g_error); - if (netconfig_bus == NULL) { - if(g_error != NULL) { - WDC_LOGE("Couldn't connect to system bus " - "error [%d: %s]", g_error->code, g_error->message); - g_error_free(g_error); - } - return WIFI_DIRECT_ERROR_COMMUNICATION_FAILED; - } - - g_dbus_connection_call_sync(netconfig_bus, - NETCONFIG_SERVICE, - NETCONFIG_WIFI_PATH, - NETCONFIG_WIFI_INTERFACE, - NETCONFIG_WIFI_LAUNCHDIRECT, - NULL, - NULL, - G_DBUS_CALL_FLAGS_NONE, - DBUS_REPLY_TIMEOUT, - NULL, - &g_error); - - if(g_error !=NULL) { - WDC_LOGE("g_dbus_connection_call_sync() failed" - "error [%d: %s]", g_error->code, g_error->message); - g_error_free(g_error); - return WIFI_DIRECT_ERROR_PERMISSION_DENIED; - } - - g_object_unref(netconfig_bus); - - WDC_LOGD("Successfully launched wfd-manager"); - return WIFI_DIRECT_ERROR_NONE; -} - int wifi_direct_initialize(void) { __WDC_LOG_FUNC_START__; @@ -639,11 +596,6 @@ int wifi_direct_initialize(void) return WIFI_DIRECT_ERROR_OPERATION_FAILED; } - WDC_LOGD("Launching wfd-server..\n"); - res = __wfd_client_launch_server_dbus(); - if (res != WIFI_DIRECT_ERROR_NONE) - WDC_LOGE("Failed to send dbus msg[%s]", strerror(errno)); - g_client_info.is_registered = TRUE; /* Initialize callbacks */