INCLUDE_DIRECTORIES(${pkgs_INCLUDE_DIRS})
LINK_DIRECTORIES(${pkgs_LIBRARY_DIRS})
-IF(TIZEN_DA)
- ADD_DEFINITIONS("-DTIZEN_DA")
-ENDIF(TIZEN_DA)
-
FILE(GLOB SRCS src/*.c)
ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRCS})
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LIBRARIES})
%description
Network Wi-Fi Manager library in Tizen C API
-%package extension-da
-Summary: Network Wi-Fi Manager library in Tizen C API for Appliance devices
-Group: Network & Connectivity/Development
-Requires: %{name} = %{version}-%{release}
-
-%description extension-da
-Network Wi-Fi Manager library in Tizen C API for Appliance devices
-
%package devel
Summary: Network Wi-Fi Manager library in Tizen C API (Development)
Group: Network & Connectivity/Development
%description tool
Test Application for Wi-Fi Manager
-%package extension-da-tool
-Summary: Test Application for Wi-Fi Manager (for Appliance devices)
-Group: Network & Connectivity/Utilities
-Requires: %{name} = %{version}
-
-%description extension-da-tool
-Test Application for Wi-Fi Manager (for Appliance devices)
-
%if 0%{?gcov:1}
%package gcov
Summary: Coverage Data of %{name}
MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
-# Build for appliance
-%cmake . -DFULLVER=%{version} -DMAJORVER=${MAJORVER} \
- -DCMAKE_VERBOSE_MAKEFILE=OFF \
- -DTIZEN_DA=1 \
- -DBIN_INSTALL_DIR:PATH=%{_bindir}
-
-%make_install
-mv %{buildroot}%{_libdir}/lib%{name}.so.%{version} %{_builddir}/%{name}-%{version}/lib%{name}.so.%{version}.da
-mv %{buildroot}%{_bindir}/wifi_manager_test %{_builddir}/%{name}-%{version}/wifi_manager_test.da
-
-make %{?_smp_mflags}
-
# Build for common
%cmake . -DFULLVER=%{version} -DMAJORVER=${MAJORVER} \
-DCMAKE_VERBOSE_MAKEFILE=OFF \
- -DTIZEN_DA=0 \
-DBIN_INSTALL_DIR:PATH=%{_bindir}
make %{?_smp_mflags}
genhtml %{name}.info -o out --legend --show-details
%endif
-mv %{_builddir}/%{name}-%{version}/lib%{name}.so.%{version}.da %{buildroot}%{_libdir}
-mv %{_builddir}/%{name}-%{version}/wifi_manager_test.da %{buildroot}%{_bindir}
-
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%files
%manifest %{name}.manifest
%{_libdir}/lib%{name}.so.*
-%exclude %{_libdir}/lib%{name}.so.%{version}.da
%license LICENSE.APLv2
%files devel
%files tool
%manifest %{name}.manifest
-%exclude %{_bindir}/wifi_manager_test.da
%{_bindir}/wifi_manager_test
%{_bindir}/wifi_mgr_tool
%{_bindir}/wifi_connect_tool
%files unittests
%{_bindir}/gtest-wifi-manager
-%{_bindir}/tizen-unittests/%{name}/run-unittest.sh
-
-%files extension-da
-%{_libdir}/lib%{name}.so.%{version}.da
-
-%preun extension-da
-rm %{_libdir}/lib%{name}.so.%{version}
-
-%post extension-da
-mv %{_libdir}/lib%{name}.so.%{version}.da %{_libdir}/lib%{name}.so.%{version}
-
-%files extension-da-tool
-%{_bindir}/wifi_manager_test.da
-
-%preun extension-da-tool
-rm %{_bindir}/wifi_manager_test
-
-%post extension-da-tool
-mv %{_bindir}/wifi_manager_test.da %{_bindir}/wifi_manager_test
+%{_bindir}/tizen-unittests/%{name}/run-unittest.sh
\ No newline at end of file
#define WIFI_SECURITY_OWE "owe"
#define WIFI_SECURITY_DPP "dpp"
-#if defined TIZEN_DA
#include "network_signal.h"
__thread guint connection_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)
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)
{
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;
__NETWORK_FUNC_EXIT__;
}
-#if defined TIZEN_DA
static gboolean __check_connection_callback(gpointer data)
{
net_event_info_s *event_data = NULL;
return FALSE;
}
-#endif /* TIZEN_DA */
static void __net_scan_reply(GObject *source_object, GAsyncResult *res, gpointer user_data)
{
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;
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;
__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 (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 (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 DBUS_OBJECT_PATH_MAX 150
-#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;
extern __thread guint bssid_scan_cb_timer;
-#endif /* TIZEN_DA */
//LCOV_EXCL_START
static int __net_check_get_privilege(network_info_s *network_info)
return NET_ERR_IN_PROGRESS; //LCOV_EXCL_LINE
}
-#if defined TIZEN_DA
if (connection_cb_timer > 0) {
g_source_remove(connection_cb_timer);
connection_cb_timer = 0;
g_source_remove(bssid_scan_cb_timer);
bssid_scan_cb_timer = 0;
}
-#endif /* TIZEN_DA */
if (network_info->request_table[NETWORK_REQUEST_TYPE_SCAN].flag == TRUE)
memset(&(network_info->request_table[NETWORK_REQUEST_TYPE_SCAN]),
#define NET_WPS_EI_OPERATION_FAILED 1
#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;
extern __thread guint bssid_scan_cb_timer;
-#endif /* TIZEN_DA */
struct cs_tid_info {
int tid;
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 (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 (old_state == new_state)
return Error;
-#if defined TIZEN_DA
/*
* Send connection state callback to upper layer.
* This problem is that the target does not send the connection state callback to upper layer if its usb module is reattaced.
if ((old_state == NET_STATE_TYPE_READY || old_state == NET_STATE_TYPE_ONLINE)
&& new_state == NET_STATE_TYPE_CONFIGURATION)
return Error;
-#endif /* TIZEN_DA */
network_info->service_state = new_state;
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));
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;
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)
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;
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__;
network_info->subscribe_id_connman_roaming);
g_dbus_connection_signal_unsubscribe(network_info->connection,
network_info->subscribe_id_netconfig_wifi);
-#if defined TIZEN_DA
g_dbus_connection_signal_unsubscribe(network_info->connection,
network_info->subscribe_id_connman_dhcp);
-#endif /* TIZEN_DA */
}
__NETWORK_FUNC_EXIT__;
void _net_set_cs_tid(network_info_s *network_info, int tid);
void _net_unset_cs_tid(int tid);
-#if defined TIZEN_DA
int __net_dbus_get_bssid_list(network_info_s *network_info);
-#endif /* TIZEN_DA */
#ifdef __cplusplus
}
last_prof_info.bssid_list = NULL;
}
-#if defined TIZEN_DA
/*
* Fix connection callback issue.
* It ignore configuration state after disconnection state in connection_state_changed_cb.
}
last_state = state;
-#endif /* TIZEN_DA */
WIFI_LOG(WIFI_INFO, "%s state changed : %s", profile_name, __convert_ap_state_to_string(state));
if ((_wifi_check_profile_name_validity(event_cb->ProfileName) !=
true) && (event_cb->Error !=
NET_ERR_CONNECTION_CONNECT_FAILED) &&
-#if defined TIZEN_DA
/*
* Send the connection callback to upper layer when specific failure case.
* It has the problem that does not connection callback to wifi-manager
*/
(event_cb->Error !=
NET_ERR_INVALID_OPERATION) &&
-#endif /* TIZEN_DA */
(event_cb->Error !=
NET_ERR_CONNECTION_WPS_TIMEOUT) &&
(event_cb->Error !=
case NET_EVENT_WIFI_ROAM_STATE_IND:
__roaming_state_changed_cb(wifi_handle, (net_roam_event_info_s *)event_cb->Data);
break;
-#if defined TIZEN_DA
case NET_EVENT_WIFI_TIMEOUT_RSP:
result = __convert_to_ap_error_type(event_cb->Error);
WIFI_LOG(WIFI_ERROR, "Connection close error %s", __convert_ap_error_type_to_string(result));
__connected_cb(wifi_handle, result);
break;
-#endif /* TIZEN_DA */
case NET_EVENT_WIFI_DHCP_STATE_IND:
{
net_event_e err = event_cb->Error;