Fix: Call connection callback at reception of "DisconectionInd" event 42/179742/2 accepted/tizen/unified/20180523.144416 submit/tizen/20180522.233138
authorMilind Murhekar <m.murhekar@samsung.com>
Mon, 21 May 2018 13:39:18 +0000 (19:09 +0530)
committerNishant Chaprana <n.chaprana@samsung.com>
Mon, 21 May 2018 13:59:55 +0000 (13:59 +0000)
Description: This patch fixes the scenario in which connection callback
is never called when wfd-manager sends DisconnectionInd event.

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

index f3d988fdc1742757d22736e656d4b92010bbc181..dc91a1299236fae60784c2ae25ff14fd92400f16 100644 (file)
@@ -3,7 +3,7 @@
 
 Name:       capi-network-wifi-direct
 Summary:    Network WiFi-Direct Library
-Version:    1.2.93
+Version:    1.2.94
 Release:    1
 Group:      Network & Connectivity/API
 License:    Apache-2.0
index d6662521f447544508465c7280cb5d7df9e6e822..c7a7298ff042a821a8c72df09d957b754fd63635 100644 (file)
@@ -343,12 +343,6 @@ void wifi_direct_process_manage_disconnection_ind(GDBusConnection *connection,
                return;
        }
 
-       if (!client->peer_data_connection_cb) {
-               WDC_LOGI("peer_data_connection_cb is NULL!!");
-               __WDC_LOG_FUNC_END__;
-               return;
-       }
-
        g_variant_get(parameters, "(ii&s&s)",
                        &error_code, &connection_state, &peer_mac_address, &peer_dev_name);
 
@@ -356,10 +350,19 @@ void wifi_direct_process_manage_disconnection_ind(GDBusConnection *connection,
        g_strlcpy(data_s.mac_address, peer_mac_address, WIFI_DIRECT_MAC_ADDRESS_LEN+1);
        g_strlcpy(data_s.device_name, peer_dev_name, WIFI_DIRECT_MAX_DEVICE_NAME_LEN+1);
 
-       client->peer_data_connection_cb(error_code,
-                             connection_state,
-                                 data_s,
-                             client->user_data_for_cb_peer_data_connection);
+       if (client->connection_cb) {
+               client->connection_cb(error_code,
+                                       connection_state,
+                                       peer_mac_address,
+                                       client->user_data_for_cb_connection);
+       }
+
+       if (client->peer_data_connection_cb) {
+               client->peer_data_connection_cb(error_code,
+                                       connection_state,
+                                       data_s,
+                                       client->user_data_for_cb_peer_data_connection);
+       }
 
        __WDC_LOG_FUNC_END__;
 }