}
static void __net_handle_state_ind(network_info_s *network_info,
- const char *profile_name, net_state_type_e profile_state)
+ const char *profile_name, net_profile_info_s *prof_info)
{
__NETWORK_FUNC_ENTER__;
g_strlcpy(event_data->ProfileName, profile_name, sizeof(event_data->ProfileName));
- event_data->Datalength = sizeof(net_state_type_e);
- event_data->Data = &profile_state;
+ event_data->Datalength = sizeof(net_profile_info_s);
+ event_data->Data = prof_info;
WIFI_LOG(WIFI_INFO,
"Sending NET_EVENT_NET_STATE_IND, state: %d, profile name: %s",
- profile_state, event_data->ProfileName);
+ prof_info->ProfileState, event_data->ProfileName);
if (network_info->event_callback)
network_info->event_callback(event_data, network_info->user_data);
event_data->Event = NET_EVENT_CLOSE_RSP;
} else {
- __net_handle_state_ind(network_info, profile_info->ProfileName, NET_STATE_TYPE_FAILURE);
+ __net_handle_state_ind(network_info, profile_info->ProfileName, profile_info);
g_free(event_data);
__NETWORK_FUNC_EXIT__;
return;
case NET_STATE_TYPE_ASSOCIATION:
case NET_STATE_TYPE_CONFIGURATION:
- __net_handle_state_ind(network_info, sig_path, new_state);
+ __net_handle_state_ind(network_info, sig_path, prof_info);
break;
case NET_STATE_TYPE_READY:
{
bool is_requested = false;
net_profile_info_s *prof_info_p = NULL;
- net_profile_info_s prof_info;
wifi_manager_error_e result = WIFI_MANAGER_ERROR_NONE;
- bool is_profile_exists = false;
- GSList *list = NULL;
wifi_manager_handle_s *wifi_handle = user_data;
switch (event_cb->Event) {
if (_wifi_check_profile_name_validity(event_cb->ProfileName) != true)
return;
- if (event_cb->Datalength != sizeof(net_state_type_e))
+ if (event_cb->Datalength != sizeof(net_profile_info_s))
return;
- net_state_type_e *profile_state = (net_state_type_e *)event_cb->Data;
- wifi_manager_connection_state_e ap_state = _wifi_convert_to_ap_state(*profile_state);
+ prof_info_p = (net_profile_info_s *)event_cb->Data;
+ net_state_type_e profile_state = prof_info_p->ProfileState;
+ wifi_manager_connection_state_e ap_state = _wifi_convert_to_ap_state(profile_state);
WIFI_LOG(WIFI_INFO, "state: %s", __convert_ap_state_to_string(ap_state));
WIFI_LOG(WIFI_INFO, "profile name: %s", event_cb->ProfileName);
- if (net_get_profile_info(wifi_handle->network_info,
- event_cb->ProfileName, &prof_info) == NET_ERR_NONE) {
- __state_changed_cb(wifi_handle, event_cb->ProfileName, &prof_info, ap_state);
-
- /* Free internal GSList */
- if (prof_info.vsie_list) {
- g_slist_free_full(prof_info.vsie_list, g_free);
- prof_info.vsie_list = NULL;
- }
-
- if (prof_info.bssid_list) {
- g_slist_free_full(prof_info.bssid_list, g_free);
- prof_info.bssid_list = NULL;
- }
- } else if (ap_state == WIFI_MANAGER_CONNECTION_STATE_DISCONNECTED) {
- net_profile_info_s *profile = NULL;
- for (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 == true) {
- profile->ProfileState = *profile_state;
- __state_changed_cb(wifi_handle, event_cb->ProfileName, profile, ap_state);
- } else
- __state_changed_cb(wifi_handle, event_cb->ProfileName, NULL, ap_state);
- } else
- __state_changed_cb(wifi_handle, event_cb->ProfileName, NULL, ap_state);
+ __state_changed_cb(wifi_handle, event_cb->ProfileName, prof_info_p, ap_state);
break;
case NET_EVENT_WIFI_SCAN_RSP: