#if defined TIZEN_DA
#include "network_signal.h"
+__thread guint connection_cb_timer = 0;
+
__thread guint full_scan_cb_timer = 0;
__thread guint specific_scan_cb_timer = 0;
__thread guint multi_scan_cb_timer = 0;
return ret;
}
+#if defined TIZEN_DA
+static gboolean __check_connection_callback(gpointer data);
+#endif /* TIZEN_DA */
+
static void __net_open_connection_reply(GObject *source_object, GAsyncResult *res, gpointer user_data)
{
__NETWORK_FUNC_ENTER__;
g_variant_unref(reply);
if (Error == NET_ERR_NONE) {
+#if defined TIZEN_DA
+ if (connection_cb_timer > 0) {
+ g_source_remove(connection_cb_timer);
+ connection_cb_timer = 0;
+ }
+ connection_cb_timer = g_timeout_add_seconds(50, __check_connection_callback, (void *)network_info);
+#endif /* TIZEN_DA */
__NETWORK_FUNC_EXIT__;
return;
}
if (open_info->flag == TRUE) {
g_strlcpy(event_data->ProfileName, open_info->ProfileName,
NET_PROFILE_NAME_LEN_MAX + 1);
+#if defined TIZEN_DA
+ if (connection_cb_timer > 0) {
+ g_source_remove(connection_cb_timer);
+ connection_cb_timer = 0;
+ }
+#endif /* TIZEN_DA */
memset(open_info, 0, sizeof(network_request_table_s));
event_data->Error = Error;
}
#if defined TIZEN_DA
+static gboolean __check_connection_callback(gpointer data)
+{
+ net_event_info_s *event_data = NULL;
+ network_info_s *network_info = (network_info_s *)data;
+ network_request_table_s *request_table = network_info->request_table;
+ net_err_e Error = NET_ERR_NONE;
+
+ WIFI_LOG(WIFI_INFO, "Check the connection callback.");
+
+ if (request_table[NETWORK_REQUEST_TYPE_OPEN_CONNECTION].flag == TRUE) {
+ WIFI_LOG(WIFI_INFO, "It did not receive the connection callback until 50 sec... send the callback forcibly.");
+
+ request_table[NETWORK_REQUEST_TYPE_CLOSE_CONNECTION].flag = TRUE;
+ g_strlcpy(request_table[NETWORK_REQUEST_TYPE_CLOSE_CONNECTION].ProfileName,
+ request_table[NETWORK_REQUEST_TYPE_OPEN_CONNECTION].ProfileName, NET_PROFILE_NAME_LEN_MAX + 1);
+
+ Error = _net_dbus_close_connection(network_info, request_table[NETWORK_REQUEST_TYPE_CLOSE_CONNECTION].ProfileName);
+ if (Error != NET_ERR_NONE) {
+ WIFI_LOG(WIFI_ERROR, "Failed to request close connection, Error [%s]", _net_print_error(Error));
+ memset(&(request_table[NETWORK_REQUEST_TYPE_CLOSE_CONNECTION]), 0, sizeof(network_request_table_s));
+ return TRUE;
+ }
+
+ event_data = g_try_malloc0(sizeof(net_event_info_s));
+ if (event_data == NULL) {
+ WIFI_LOG(WIFI_ERROR, "Failed to allocate dynamic memory.");
+ return TRUE;
+ }
+
+ g_strlcpy(event_data->ProfileName, request_table[NETWORK_REQUEST_TYPE_CLOSE_CONNECTION].ProfileName,
+ NET_PROFILE_NAME_LEN_MAX + 1);
+ memset(&request_table[NETWORK_REQUEST_TYPE_OPEN_CONNECTION], 0, sizeof(network_request_table_s));
+
+ event_data->Event = NET_EVENT_WIFI_TIMEOUT_RSP;
+ event_data->Error = NET_ERR_CONNECTION_CONNECT_FAILED;
+ event_data->Datalength = 0;
+ event_data->Data = NULL;
+
+ network_info->service_state = NET_STATE_TYPE_IDLE;
+
+ if (network_info->event_callback)
+ network_info->event_callback(event_data, network_info->user_data);
+
+ g_free(event_data);
+ }
+
+ connection_cb_timer = 0;
+
+ return FALSE;
+}
+
static gboolean __check_full_scan_callback(gpointer data)
{
net_event_info_s *event_data = NULL;
#define NET_WPS_EI_SECURITY_WEP_PROHIBITED 2
#if defined TIZEN_DA
+
+extern __thread guint connection_cb_timer;
+
extern __thread guint full_scan_cb_timer;
extern __thread guint specific_scan_cb_timer;
extern __thread guint multi_scan_cb_timer;
if (request_table[NETWORK_REQUEST_TYPE_OPEN_CONNECTION].flag == TRUE &&
strstr(profile_info->ProfileName, svc_name1) != NULL) {
+#if defined TIZEN_DA
+ if (connection_cb_timer > 0) {
+ g_source_remove(connection_cb_timer);
+ connection_cb_timer = 0;
+ }
+#endif /* TIZEN_DA */
memset(&request_table[NETWORK_REQUEST_TYPE_OPEN_CONNECTION], 0,
sizeof(network_request_table_s));
if (request_table[NETWORK_REQUEST_TYPE_OPEN_CONNECTION].flag == TRUE &&
strstr(profile_info->ProfileName, svc_name2) != NULL) {
+#if defined TIZEN_DA
+ if (connection_cb_timer > 0) {
+ g_source_remove(connection_cb_timer);
+ connection_cb_timer = 0;
+ }
+#endif /* TIZEN_DA */
memset(&request_table[NETWORK_REQUEST_TYPE_OPEN_CONNECTION], 0,
sizeof(network_request_table_s));
if (request_table[NETWORK_REQUEST_TYPE_OPEN_CONNECTION].flag == TRUE &&
strstr(sig_path, svc_name1) != NULL) {
+#if defined TIZEN_DA
+ if (connection_cb_timer > 0) {
+ g_source_remove(connection_cb_timer);
+ connection_cb_timer = 0;
+ }
+#endif /* TIZEN_DA */
memset(&request_table[NETWORK_REQUEST_TYPE_OPEN_CONNECTION], 0,
sizeof(network_request_table_s));
WIFI_LOG(WIFI_ERROR, "Failed to connect WiFi");
if (open_info->flag == TRUE) {
+#if defined TIZEN_DA
+ if (connection_cb_timer > 0) {
+ g_source_remove(connection_cb_timer);
+ connection_cb_timer = 0;
+ }
+#endif /* TIZEN_DA */
memset(open_info, 0, sizeof(network_request_table_s));
event_data->Error = NET_ERR_INVALID_OPERATION;
event_data->Event = NET_EVENT_OPEN_RSP;