From: Milind Murhekar Date: Mon, 21 May 2018 13:39:18 +0000 (+0530) Subject: Fix: Call connection callback at reception of "DisconectionInd" event X-Git-Tag: submit/tizen/20180522.233138^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=73fa688aaa4387ebcae1b09857874aa7f511c7b4;p=platform%2Fcore%2Fapi%2Fwifi-direct.git Fix: Call connection callback at reception of "DisconectionInd" event 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 --- diff --git a/packaging/capi-network-wifi-direct.spec b/packaging/capi-network-wifi-direct.spec index f3d988f..dc91a12 100644 --- a/packaging/capi-network-wifi-direct.spec +++ b/packaging/capi-network-wifi-direct.spec @@ -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 diff --git a/src/wifi-direct-client-proxy.c b/src/wifi-direct-client-proxy.c index d666252..c7a7298 100644 --- a/src/wifi-direct-client-proxy.c +++ b/src/wifi-direct-client-proxy.c @@ -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__; }