[tdls]:Added handling to support more than one app 75/131475/2 accepted/tizen/unified/20170602.154233 submit/tizen/20170601.042236
authorManeesh Jain <maneesh.jain@samsung.com>
Mon, 29 May 2017 09:57:27 +0000 (15:27 +0530)
committerManeesh Jain <maneesh.jain@samsung.com>
Mon, 29 May 2017 10:02:36 +0000 (10:02 +0000)
Description: This patch uses to add the handing while more
than one application will try to call the TDLS Discovery function.

Change-Id: Ie775d6bcef1b8f695be484de1145ddf449719a1f
Signed-off-by: Maneesh Jain <maneesh.jain@samsung.com>
include/wifi-tdls.h
src/wifi-tdls.c

index db8acc7..9301971 100755 (executable)
 typedef enum {
        NETCONFIG_ERROR_TDLS_NO_ERROR                           = 0x00,
        NETCONFIG_ERROR_TDLS_FAIL_DISCOVER                      = 0x01,
-       NETCONFIG_ERROR_TDLS_FAIL_DISCONNECT                    = 0x02,
+       NETCONFIG_ERROR_TDLS_FAIL_DISCONNECT            = 0x02,
        NETCONFIG_ERROR_TDLS_FAIL_CONNECT                       = 0x03,
        NETCONFIG_ERROR_TDLS_ALREADY_DONE                       = 0x04,
-       NETCONFIG_ERROR_TDLS_FAIL_CHANNEL_SWITCH                = 0x05,
+       NETCONFIG_ERROR_TDLS_FAIL_CHANNEL_SWITCH        = 0x05,
 } netconfig_tdls_error_e;
 
 void netconfig_wifi_tdls_peer_found_event(GVariant *message);
index 8c00068..d9b95e4 100755 (executable)
@@ -203,6 +203,12 @@ gboolean handle_tdls_discover(Wifi *wifi, GDBusMethodInvocation *context,
 
        GVariant *message = NULL;
 
+       if (tdls_timer_id > 0) {
+               DBG(" TDLS Discover is already progress !!!");
+               wifi_complete_tdls_discover(wifi, context, NETCONFIG_ERROR_TDLS_ALREADY_DONE);
+               return TRUE;
+       }
+
        message = __netconfig_wifi_tdls_send_dbus_str("TDLSDiscover", (const char*)peer_mac_Addr);
 
        if (message == NULL) {