WIFI_LOG(WIFI_INFO, "state: %s", __convert_ap_state_to_string(ap_state));
WIFI_LOG(WIFI_INFO, "profile name: %s", event_cb->ProfileName);
- __state_changed_cb(wifi_handle, event_cb->ProfileName, prof_info_p, ap_state);
+ if (ap_state == WIFI_MANAGER_CONNECTION_STATE_DISCONNECTED) {
+ net_profile_info_s *profile = NULL;
+ bool is_profile_exists = false;
+
+ for (GSList *list = wifi_handle->profile_iterator; list; list = list->next) {
+ profile = (net_profile_info_s *)list->data;
+ if (!g_strcmp0(event_cb->ProfileName, profile->ProfileName)) {
+ is_profile_exists = true;
+ break;
+ }
+ }
+ if (is_profile_exists == false)
+ prof_info_p = NULL;
+ }
+
+ __state_changed_cb(wifi_handle, event_cb->ProfileName, prof_info_p, ap_state);
break;
case NET_EVENT_WIFI_SCAN_RSP:
case NET_EVENT_WIFI_SCAN_IND: