#define WIFI_SECURITY_OWE "owe"
#define WIFI_SECURITY_DPP "dpp"
+#if defined TIZEN_DA
+#include "network_signal.h"
+
+__thread guint full_scan_cb_timer = 0;
+__thread guint specific_scan_cb_timer = 0;
+__thread guint multi_scan_cb_timer = 0;
+__thread guint bssid_scan_cb_timer = 0;
+#endif /* TIZEN_DA */
+
//LCOV_EXCL_START
static int __net_error_string_to_enum(const char *error)
{
__NETWORK_FUNC_EXIT__;
}
+#if defined TIZEN_DA
+static gboolean __check_full_scan_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;
+
+ WIFI_LOG(WIFI_INFO, "Check the full scan callback.");
+
+ if (network_info->scan_pending && (request_table[NETWORK_REQUEST_TYPE_SCAN].flag == 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;
+ }
+
+ WIFI_LOG(WIFI_INFO, "It did not receive the scan callback until 10 sec... send the callback forcibly.");
+
+ network_info->scan_pending = FALSE;
+
+ memset(&request_table[NETWORK_REQUEST_TYPE_SCAN], 0, sizeof(network_request_table_s));
+ event_data->Event = NET_EVENT_WIFI_SCAN_RSP;
+
+ event_data->Error = NET_ERR_NONE;
+ event_data->Datalength = 0;
+ event_data->Data = NULL;
+
+ if (network_info->event_callback)
+ network_info->event_callback(event_data, network_info->user_data);
+
+ memset(event_data, 0, sizeof(net_event_info_s));
+
+ wifi_manager_scan_state_e scan_state = WIFI_MANAGER_SCAN_STATE_NOT_SCANNING;
+ event_data->Event = NET_EVENT_WIFI_SCAN_CHANGED;
+ event_data->Data = &scan_state;
+ event_data->Datalength = sizeof(wifi_manager_scan_state_e);
+ event_data->Error = NET_ERR_NONE;
+
+ if (network_info->event_callback)
+ network_info->event_callback(event_data, network_info->user_data);
+
+ g_free(event_data);
+ }
+
+ full_scan_cb_timer = 0;
+
+ return FALSE;
+}
+
+static gboolean __check_specific_scan_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;
+
+ WIFI_LOG(WIFI_INFO, "Check the specific scan callback.");
+
+ if (network_info->scan_pending && (request_table[NETWORK_REQUEST_TYPE_SPECIFIC_SCAN].flag == 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;
+ }
+
+ WIFI_LOG(WIFI_INFO, "It did not receive the scan callback until 10 sec... send the callback forcibly.");
+
+ network_info->scan_pending = FALSE;
+
+ memset(&request_table[NETWORK_REQUEST_TYPE_SPECIFIC_SCAN], 0, sizeof(network_request_table_s));
+ event_data->Event = NET_EVENT_WIFI_SPECIFIC_SCAN_RSP;
+
+ event_data->Error = NET_ERR_NONE;
+ event_data->Datalength = 0;
+ event_data->Data = NULL;
+
+ if (network_info->event_callback)
+ network_info->event_callback(event_data, network_info->user_data);
+
+ g_free(event_data);
+ }
+
+ specific_scan_cb_timer = 0;
+
+ return FALSE;
+}
+
+static gboolean __check_multi_scan_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;
+
+ WIFI_LOG(WIFI_INFO, "Check the multi scan callback.");
+
+ if (network_info->scan_pending && (request_table[NETWORK_REQUEST_TYPE_MULTI_SCAN].flag == 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;
+ }
+
+ WIFI_LOG(WIFI_INFO, "It did not receive the scan callback until 10 sec... send the callback forcibly.");
+
+ network_info->scan_pending = FALSE;
+
+ memset(&request_table[NETWORK_REQUEST_TYPE_MULTI_SCAN], 0, sizeof(network_request_table_s));
+ event_data->Event = NET_EVENT_WIFI_MULTI_SCAN_RSP;
+
+ event_data->Error = NET_ERR_NONE;
+ event_data->Datalength = 0;
+ event_data->Data = NULL;
+
+ if (network_info->event_callback)
+ network_info->event_callback(event_data, network_info->user_data);
+
+ g_free(event_data);
+ }
+
+ multi_scan_cb_timer = 0;
+
+ return FALSE;
+}
+
+static gboolean __check_bssid_scan_callback(gpointer data)
+{
+ network_info_s *network_info = (network_info_s *)data;
+
+ WIFI_LOG(WIFI_INFO, "BSSID Scan Completed");
+ __net_dbus_get_bssid_list(network_info);
+
+ return FALSE;
+}
+#endif /* TIZEN_DA */
+
static void __net_scan_reply(GObject *source_object, GAsyncResult *res, gpointer user_data)
{
__NETWORK_FUNC_ENTER__;
if (reply)
g_variant_unref(reply);
+#if defined TIZEN_DA
+ if (full_scan_cb_timer > 0) {
+ g_source_remove(full_scan_cb_timer);
+ full_scan_cb_timer = 0;
+ }
+
+ if (bssid_scan_cb_timer > 0) {
+ g_source_remove(bssid_scan_cb_timer);
+ bssid_scan_cb_timer = 0;
+ }
+#endif /* TIZEN_DA */
+
request_table = network_info->request_table;
bssid_scan_info = &request_table[NETWORK_REQUEST_TYPE_BSSID_SCAN];
if (request_table[NETWORK_REQUEST_TYPE_SCAN].flag == TRUE) {
WIFI_LOG(WIFI_INFO, "Full channel Scan pending");
network_info->scan_pending = TRUE;
+#if defined TIZEN_DA
+ full_scan_cb_timer = g_timeout_add_seconds(10, __check_full_scan_callback, (void *)network_info);
+#endif /* TIZEN_DA */
} else if (bssid_scan_info->flag == TRUE) {
WIFI_LOG(WIFI_INFO, "BSSID Scan pending");
network_info->scan_pending = TRUE;
+#if defined TIZEN_DA
+ bssid_scan_cb_timer = g_timeout_add_seconds(10, __check_bssid_scan_callback, (void *)network_info);
+#endif /* TIZEN_DA */
}
+
+#if defined TIZEN_DA
+ wifi_manager_scan_state_e scan_state = WIFI_MANAGER_SCAN_STATE_SCANNING;
+ event_data->Event = NET_EVENT_WIFI_SCAN_CHANGED;
+ event_data->Data = &scan_state;
+ event_data->Datalength = sizeof(wifi_manager_scan_state_e);
+ event_data->Error = NET_ERR_NONE;
+
+ if (network_info->event_callback)
+ network_info->event_callback(event_data, network_info->user_data);
+
+ g_free(event_data);
+
+ __NETWORK_FUNC_EXIT__;
+ return;
+#endif /* TIZEN_DA */
} else if (Error != NET_ERR_NONE) {
WIFI_LOG(WIFI_ERROR, "Scan failed. Error [%d]", Error);
if (reply)
g_variant_unref(reply);
+#if defined TIZEN_DA
+ if (specific_scan_cb_timer > 0) {
+ g_source_remove(specific_scan_cb_timer);
+ specific_scan_cb_timer = 0;
+ }
+#endif /* TIZEN_DA */
+
request_table = network_info->request_table;
if (Error == NET_ERR_IN_PROGRESS) {
if (request_table[NETWORK_REQUEST_TYPE_SPECIFIC_SCAN].flag == TRUE) {
WIFI_LOG(WIFI_INFO, "Specific Scan pending");
network_info->scan_pending = TRUE;
+#if defined TIZEN_DA
+ specific_scan_cb_timer = g_timeout_add_seconds(10, __check_specific_scan_callback, (void *)network_info);
+#endif /* TIZEN_DA */
}
} else if (Error != NET_ERR_NONE) {
WIFI_LOG(WIFI_ERROR, "Specific Scan failed. Error [%d]", Error);
if (reply)
g_variant_unref(reply);
+#if defined TIZEN_DA
+ if (multi_scan_cb_timer > 0) {
+ g_source_remove(multi_scan_cb_timer);
+ multi_scan_cb_timer = 0;
+ }
+#endif /* TIZEN_DA */
+
request_table = network_info->request_table;
if (Error == NET_ERR_IN_PROGRESS) {
if (request_table[NETWORK_REQUEST_TYPE_MULTI_SCAN].flag == TRUE) {
WIFI_LOG(WIFI_INFO, "Multi Scan pending");
network_info->scan_pending = TRUE;
+#if defined TIZEN_DA
+ multi_scan_cb_timer = g_timeout_add_seconds(10, __check_multi_scan_callback, (void *)network_info);
+#endif /* TIZEN_DA */
}
} else if (Error != NET_ERR_NONE) {
WIFI_LOG(WIFI_ERROR, "Multi Scan failed. Error [%d]", Error);
#define NET_WPS_EI_OPERATION_FAILED 1
#define NET_WPS_EI_SECURITY_WEP_PROHIBITED 2
+#if defined TIZEN_DA
+extern __thread guint full_scan_cb_timer;
+extern __thread guint specific_scan_cb_timer;
+extern __thread guint multi_scan_cb_timer;
+extern __thread guint bssid_scan_cb_timer;
+#endif /* TIZEN_DA */
+
struct cs_tid_info {
int tid;
guint subscribe_id_connman_state;
static GSList *cs_tid_list = NULL;
+#if !defined TIZEN_DA
static int __net_dbus_get_bssid_list();
+#endif /* !TIZEN_DA */
static int __net_dbus_get_technology_states(network_info_s *network_info);
//LCOV_EXCL_START
if (network_info->scan_pending == TRUE) {
net_err_e Error = NET_ERR_NONE;
network_info->scan_pending = FALSE;
+#if defined TIZEN_DA
+ if (full_scan_cb_timer > 0) {
+ g_source_remove(full_scan_cb_timer);
+ full_scan_cb_timer = 0;
+ }
+ if (specific_scan_cb_timer > 0) {
+ g_source_remove(specific_scan_cb_timer);
+ specific_scan_cb_timer = 0;
+ }
+ if (multi_scan_cb_timer > 0) {
+ g_source_remove(multi_scan_cb_timer);
+ multi_scan_cb_timer = 0;
+ }
+ if (bssid_scan_cb_timer > 0) {
+ g_source_remove(bssid_scan_cb_timer);
+ bssid_scan_cb_timer = 0;
+ }
+#endif /* TIZEN_DA */
int current_scan_type = -1;
if (network_info->request_table[NETWORK_REQUEST_TYPE_SCAN].flag == TRUE)
return Error;
}
+#if defined TIZEN_DA
+int __net_dbus_get_bssid_list(network_info_s *network_info)
+#else
static int __net_dbus_get_bssid_list(network_info_s *network_info)
+#endif /* !TIZEN_DA */
{
__NETWORK_FUNC_ENTER__;