From: Jaehyun Kim Date: Thu, 27 Oct 2022 06:57:33 +0000 (+0900) Subject: DA: Save last net_profile_info_s for connection state callback X-Git-Tag: accepted/tizen/7.0/unified/20230126.170237~11 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=84dff526a6b2a7c2ae028d65fbbbf5a7eefafdef;p=platform%2Fcore%2Fapi%2Fwifi-manager.git DA: Save last net_profile_info_s for connection state callback Save the last net_profile_info_s structure to send the connection state callback. It doesn't have to send the null parameter to connection state callback. So it saves the last net_profile_info_s structure. Change-Id: Id71db25f97fad96d4403b614e27ccc8410f492ba Signed-off-by: Jaehyun Kim --- diff --git a/src/wifi_internal.c b/src/wifi_internal.c index b26399c..be4ad35 100644 --- a/src/wifi_internal.c +++ b/src/wifi_internal.c @@ -663,10 +663,17 @@ static void __state_changed_cb(wifi_manager_handle_s *wifi_handle, char *profile net_profile_info_s *profile_info, wifi_manager_connection_state_e state) { net_profile_info_s *ap_info = NULL; + static net_profile_info_s last_prof_info; if (profile_name == NULL) return; + if (profile_info != NULL) { + memcpy(&last_prof_info, profile_info, sizeof(net_profile_info_s)); + last_prof_info.vsie_list = NULL; + last_prof_info.bssid_list = NULL; + } + WIFI_LOG(WIFI_INFO, "%s state changed : %s", profile_name, __convert_ap_state_to_string(state)); if (wifi_handle->connection_state_cb) { @@ -686,6 +693,9 @@ static void __state_changed_cb(wifi_manager_handle_s *wifi_handle, char *profile _wifi_copy_bssid_list, NULL); } else { + if (!g_strcmp0(last_prof_info.ProfileName, profile_name)) + memcpy(ap_info, &last_prof_info, sizeof(net_profile_info_s)); + ap_info->network_info = wifi_handle->network_info; }