}
static void __net_handle_failure_ind(network_info_s *network_info,
- const char *profile_name)
+ net_profile_info_s *profile_info)
{
__NETWORK_FUNC_ENTER__;
const char *svc_name2 = request_table[NETWORK_REQUEST_TYPE_ENROLL_WPS].ProfileName;
const char *svc_name3 = request_table[NETWORK_REQUEST_TYPE_CLOSE_CONNECTION].ProfileName;
+ if (profile_info == NULL) {
+ __NETWORK_FUNC_EXIT__;
+ return;
+ }
+
event_data = g_try_malloc0(sizeof(net_event_info_s));
if (event_data == NULL) {
__NETWORK_FUNC_EXIT__;
return;
}
+ event_data->Datalength = sizeof(net_profile_info_s);
+ event_data->Data = profile_info;
+
if (request_table[NETWORK_REQUEST_TYPE_OPEN_CONNECTION].flag == TRUE &&
- strstr(profile_name, svc_name1) != NULL) {
+ strstr(profile_info->ProfileName, svc_name1) != NULL) {
memset(&request_table[NETWORK_REQUEST_TYPE_OPEN_CONNECTION], 0,
sizeof(network_request_table_s));
event_data->Event = NET_EVENT_OPEN_RSP;
} else if (request_table[NETWORK_REQUEST_TYPE_ENROLL_WPS].flag == TRUE &&
- g_strcmp0(profile_name, svc_name2) == 0) {
+ g_strcmp0(profile_info->ProfileName, svc_name2) == 0) {
memset(&request_table[NETWORK_REQUEST_TYPE_ENROLL_WPS], 0,
sizeof(network_request_table_s));
memset(&request_table[NETWORK_REQUEST_TYPE_CLOSE_CONNECTION], 0,
sizeof(network_request_table_s));
} else if (request_table[NETWORK_REQUEST_TYPE_CLOSE_CONNECTION].flag == TRUE &&
- g_strcmp0(profile_name, svc_name3) == 0) {
+ g_strcmp0(profile_info->ProfileName, svc_name3) == 0) {
memset(&request_table[NETWORK_REQUEST_TYPE_CLOSE_CONNECTION], 0,
sizeof(network_request_table_s));
event_data->Event = NET_EVENT_CLOSE_RSP;
} else {
- __net_handle_state_ind(network_info, profile_name, NET_STATE_TYPE_FAILURE);
+ __net_handle_state_ind(network_info, profile_info->ProfileName, NET_STATE_TYPE_FAILURE);
g_free(event_data);
__NETWORK_FUNC_EXIT__;
return;
}
g_strlcpy(event_data->ProfileName,
- profile_name, NET_PROFILE_NAME_LEN_MAX + 1);
+ profile_info->ProfileName, NET_PROFILE_NAME_LEN_MAX + 1);
if (network_info->net_service_error != NET_ERR_NONE)
event_data->Error = network_info->net_service_error;
event_data->Error = NET_ERR_CONNECTION_CONNECT_FAILED;
WIFI_LOG(WIFI_ERROR, "Event error defined %d", event_data->Error);
}
- event_data->Datalength = 0;
- event_data->Data = NULL;
network_info->net_service_error = NET_ERR_NONE;
}
static void __net_handle_disconnect_ind(network_info_s *network_info,
- const char *profile_name)
+ net_profile_info_s *profile_info)
{
__NETWORK_FUNC_ENTER__;
const char *svc_name2 = request_table[NETWORK_REQUEST_TYPE_OPEN_CONNECTION].ProfileName;
const char *svc_name3 = request_table[NETWORK_REQUEST_TYPE_ENROLL_WPS].ProfileName;
+ if (profile_info == NULL) {
+ __NETWORK_FUNC_EXIT__;
+ return;
+ }
+
event_data = g_try_malloc0(sizeof(net_event_info_s));
if (event_data == NULL) {
__NETWORK_FUNC_EXIT__;
return;
}
+ event_data->Datalength = sizeof(net_profile_info_s);
+ event_data->Data = profile_info;
+
if (request_table[NETWORK_REQUEST_TYPE_OPEN_CONNECTION].flag == TRUE &&
- strstr(profile_name, svc_name2) != NULL) {
+ strstr(profile_info->ProfileName, svc_name2) != NULL) {
memset(&request_table[NETWORK_REQUEST_TYPE_OPEN_CONNECTION], 0,
sizeof(network_request_table_s));
/** Send Open Resp */
event_data->Error = NET_ERR_OPERATION_ABORTED;
event_data->Event = NET_EVENT_OPEN_RSP;
- g_strlcpy(event_data->ProfileName, profile_name, NET_PROFILE_NAME_LEN_MAX + 1);
+ g_strlcpy(event_data->ProfileName, profile_info->ProfileName, NET_PROFILE_NAME_LEN_MAX + 1);
WIFI_LOG(WIFI_INFO, "Sending NET_EVENT_OPEN_RSP");
}
if (request_table[NETWORK_REQUEST_TYPE_ENROLL_WPS].flag == TRUE &&
- g_strcmp0(profile_name, svc_name3) == 0) {
+ g_strcmp0(profile_info->ProfileName, svc_name3) == 0) {
memset(&request_table[NETWORK_REQUEST_TYPE_ENROLL_WPS], 0,
sizeof(network_request_table_s));
/** Send WPS Resp */
event_data->Error = NET_ERR_OPERATION_ABORTED;
event_data->Event = NET_EVENT_WIFI_WPS_RSP;
- g_strlcpy(event_data->ProfileName, profile_name, NET_PROFILE_NAME_LEN_MAX + 1);
+ g_strlcpy(event_data->ProfileName, profile_info->ProfileName, NET_PROFILE_NAME_LEN_MAX + 1);
WIFI_LOG(WIFI_INFO, "Sending NET_EVENT_WIFI_WPS_RSP");
}
if (request_table[NETWORK_REQUEST_TYPE_CLOSE_CONNECTION].flag == TRUE &&
- g_strcmp0(profile_name, svc_name1) == 0) {
+ g_strcmp0(profile_info->ProfileName, svc_name1) == 0) {
memset(&request_table[NETWORK_REQUEST_TYPE_CLOSE_CONNECTION], 0,
sizeof(network_request_table_s));
/** Send Close Resp */
event_data->Error = NET_ERR_NONE;
event_data->Event = NET_EVENT_CLOSE_RSP;
- g_strlcpy(event_data->ProfileName, profile_name, NET_PROFILE_NAME_LEN_MAX + 1);
+ g_strlcpy(event_data->ProfileName, profile_info->ProfileName, NET_PROFILE_NAME_LEN_MAX + 1);
WIFI_LOG(WIFI_INFO, "Sending NET_EVENT_CLOSE_RSP");
/** Send Close Ind */
event_data->Error = NET_ERR_NONE;
event_data->Event = NET_EVENT_CLOSE_IND;
- g_strlcpy(event_data->ProfileName, profile_name, NET_PROFILE_NAME_LEN_MAX + 1);
+ g_strlcpy(event_data->ProfileName, profile_info->ProfileName, NET_PROFILE_NAME_LEN_MAX + 1);
WIFI_LOG(WIFI_INFO, "Sending NET_EVENT_CLOSE_IND");
if (old_state == NET_STATE_TYPE_DISCONNECT) {
break;
} else if (old_state != NET_STATE_TYPE_FAILURE) {
- __net_handle_disconnect_ind(network_info, sig_path);
+ __net_handle_disconnect_ind(network_info, prof_info);
break;
}
}
case NET_STATE_TYPE_DISCONNECT:
{
- __net_handle_disconnect_ind(network_info, sig_path);
+ __net_handle_disconnect_ind(network_info, prof_info);
break;
}
case NET_STATE_TYPE_FAILURE:
- __net_handle_failure_ind(network_info, sig_path);
+ __net_handle_failure_ind(network_info, prof_info);
break;
default:
switch (event_cb->Error) {
case NET_ERR_NONE:
- 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,
- WIFI_MANAGER_CONNECTION_STATE_DISCONNECTED);
-
- /* Free internal GSList */
- if (prof_info.vsie_list) {
- g_slist_free_full(prof_info.vsie_list, g_free);
- prof_info.vsie_list = NULL;
- }
+ if (event_cb->Datalength == sizeof(net_profile_info_s))
+ prof_info_p = (net_profile_info_s *)event_cb->Data;
- if (prof_info.bssid_list) {
- g_slist_free_full(prof_info.bssid_list, g_free);
- prof_info.bssid_list = NULL;
- }
- } else
- __state_changed_cb(wifi_handle, event_cb->ProfileName, NULL,
- WIFI_MANAGER_CONNECTION_STATE_DISCONNECTED);
+ __state_changed_cb(wifi_handle, event_cb->ProfileName, prof_info_p,
+ WIFI_MANAGER_CONNECTION_STATE_DISCONNECTED);
WIFI_LOG(WIFI_INFO, "Connection close succeeded!");
/* Checking if disconnection request was sent when WPS PBC connection