Added Handling of ON DEMAND Services for wfd-manager in intialise call 18/85518/3 accepted/tizen/common/20160831.161656 accepted/tizen/ivi/20160831.080224 accepted/tizen/mobile/20160831.080101 accepted/tizen/tv/20160831.080127 accepted/tizen/wearable/20160831.080155 submit/tizen/20160831.022854
authorMilind Ramesh Murhekar <m.murhekar@samsung.com>
Thu, 25 Aug 2016 12:03:56 +0000 (17:33 +0530)
committerMilind Ramesh Murhekar <m.murhekar@samsung.com>
Tue, 30 Aug 2016 13:17:44 +0000 (18:47 +0530)
Description: Added dbus method call to Add active client id
when application calls wifi_direct_initialise().

Change-Id: If15b54fa1fcbc19b067993367d7a765c01d0adeb
Signed-off-by: Milind Ramesh Murhekar <m.murhekar@samsung.com>
CMakeLists.txt
packaging/capi-network-wifi-direct.spec
src/CMakeLists.txt
src/wifi-direct-client-proxy.c

index bc444e7..1832156 100644 (file)
@@ -12,5 +12,9 @@ SET(pc_dependents "capi-base-common")
 #SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -Wall -Werror -fprofile-arcs -ftest-coverage")
 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -Wall -Werror")
 
+IF(TIZEN_FEATURE_WIFI_DIRECT_ON_DEMAND)
+       ADD_DEFINITIONS(-DTIZEN_FEATURE_WIFI_DIRECT_ON_DEMAND)
+ENDIF(TIZEN_FEATURE_WIFI_DIRECT_ON_DEMAND)
+
 ADD_SUBDIRECTORY(src)
 #ADD_SUBDIRECTORY(test)
index ecf503a..5e365a5 100644 (file)
@@ -61,6 +61,7 @@ MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
 
 cmake -DCMAKE_INSTALL_PREFIX=%{_prefix} \
 %if "%{profile}" == "common"
+       -DTIZEN_FEATURE_WIFI_DIRECT_ON_DEMAND=1 \
        -DTIZEN_FEATURE_SERVICE_DISCOVERY=1 \
        -DTIZEN_FEATURE_WIFI_DISPLAY=1 \
 %else
@@ -69,10 +70,12 @@ cmake -DCMAKE_INSTALL_PREFIX=%{_prefix} \
        -DTIZEN_FEATURE_WIFI_DISPLAY=0 \
 %else
 %if "%{profile}" == "mobile"
+    -DTIZEN_FEATURE_WIFI_DIRECT_ON_DEMAND=1 \
        -DTIZEN_FEATURE_SERVICE_DISCOVERY=1 \
        -DTIZEN_FEATURE_WIFI_DISPLAY=1 \
 %else
 %if "%{profile}" == "tv"
+    -DTIZEN_FEATURE_WIFI_DIRECT_ON_DEMAND=1 \
        -DTIZEN_FEATURE_SERVICE_DISCOVERY=1 \
        -DTIZEN_FEATURE_WIFI_DISPLAY=1 \
 %endif
index ed2c1b8..eb30da1 100644 (file)
@@ -95,6 +95,10 @@ IF(TIZEN_FEATURE_WIFI_DISPLAY)
        ADD_DEFINITIONS(-DTIZEN_FEATURE_WIFI_DISPLAY)
        SET(FEATURES "${FEATURES} -DTIZEN_FEATURE_WIFI_DISPLAY")
 ENDIF(TIZEN_FEATURE_WIFI_DISPLAY)
+IF(TIZEN_FEATURE_WIFI_DIRECT_ON_DEMAND)
+       ADD_DEFINITIONS(-DTIZEN_FEATURE_WIFI_DIRECT_ON_DEMAND)
+       SET(FEATURES "${FEATURES} -DTIZEN_FEATURE_WIFI_DIRECT_ON_DEMAND")
+ENDIF(TIZEN_FEATURE_WIFI_DIRECT_ON_DEMAND)
 
 # Linker flags
 SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed, --rpath=${LIBDIR}")
index 5cefcec..02d4236 100644 (file)
@@ -737,6 +737,19 @@ int wifi_direct_initialize(void)
                return WIFI_DIRECT_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE
        }
 
+#ifdef TIZEN_FEATURE_WIFI_DIRECT_ON_DEMAND
+       reply = wifi_direct_dbus_method_call_sync(WFD_MANAGER_MANAGE_INTERFACE,
+                                                 "AddClient", NULL, &error);
+       res = __net_wifidirect_gerror_to_enum(error);
+       if (res != WIFI_DIRECT_ERROR_NONE) {
+               WDC_LOGE("Failed to Add Active Client");
+               return res;
+       }
+
+       g_variant_get(reply, "(i)", &res);
+       WDC_LOGD("Active Client id Added, ret[%d]", res);
+#endif/* TIZEN_FEATURE_WIFI_DIRECT_ON_DEMAND */
+
        reply = wifi_direct_dbus_method_call_sync(WFD_MANAGER_GROUP_INTERFACE,
                                                  "IsGroupOwner", NULL, &error);