From 6e5feab87512b8cee3c28b56c31c4e9e8bc9ef66 Mon Sep 17 00:00:00 2001 From: Maneesh Jain Date: Mon, 29 May 2017 15:27:27 +0530 Subject: [PATCH] [tdls]:Added handling to support more than one app 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 --- include/wifi-tdls.h | 4 ++-- src/wifi-tdls.c | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/include/wifi-tdls.h b/include/wifi-tdls.h index db8acc7..9301971 100755 --- a/include/wifi-tdls.h +++ b/include/wifi-tdls.h @@ -30,10 +30,10 @@ 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); diff --git a/src/wifi-tdls.c b/src/wifi-tdls.c index 8c00068..d9b95e4 100755 --- a/src/wifi-tdls.c +++ b/src/wifi-tdls.c @@ -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) { -- 2.34.1