summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
d1d3f0c)
Change-Id: I9a18a6245d17fe7285dfa9d8ea2fda0841679f73
Signed-off-by: Seonah Moon <seonah1.moon@samsung.com>
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)
-SET(dependents "elementary evas ui-gadget-1 capi-network-tethering capi-network-connection capi-network-wifi notification aul bundle efl-extension dpm")
+SET(dependents "elementary evas ui-gadget-1 capi-network-tethering capi-network-connection capi-network-wifi-manager notification aul bundle efl-extension dpm")
SET(CMAKE_BUILD_TYPE "Release")
SET(CMAKE_BUILD_TYPE "Release")
int _handle_wifi_onoff_change(mh_appdata_t *ad);
int _handle_bt_onoff_change(mh_appdata_t *ad);
int _handle_usb_onoff_change(mh_appdata_t *ad);
int _handle_wifi_onoff_change(mh_appdata_t *ad);
int _handle_bt_onoff_change(mh_appdata_t *ad);
int _handle_usb_onoff_change(mh_appdata_t *ad);
-int _turn_on_wifi(void);
bool _is_wifi_direct_on(void);
bool _is_wifi_direct_on(void);
-void _wifi_state_changed_cb(wifi_device_state_e state, void *user_data);
+void _wifi_state_changed_cb(wifi_manager_device_state_e state, void *user_data);
void _wifi_tethering_checkbox_popup_status_set(bool value);
bool _wifi_tethering_checkbox_popup_status_get(void);
gboolean _ps_recheck_timeout_cb(gpointer data);
void _wifi_tethering_checkbox_popup_status_set(bool value);
bool _wifi_tethering_checkbox_popup_status_get(void);
gboolean _ps_recheck_timeout_cb(gpointer data);
#include <Elementary.h>
#include <vconf.h>
#include <ui-gadget-module.h>
#include <Elementary.h>
#include <vconf.h>
#include <ui-gadget-module.h>
-#include <wifi.h>
-#include <net_connection.h>
+#include <net_connection.h>
+#include <wifi-manager.h>
#include <dlog.h>
#include <notification.h>
#include <dlog.h>
#include <notification.h>
tethering_h handle;
connection_h conn_handle;
tethering_h handle;
connection_h conn_handle;
+ wifi_manager_h wifi_handle;
tethering_type_e type;
Evas_Object *win;
tethering_type_e type;
Evas_Object *win;
Name: ug-setting-mobileap-efl
Summary: Tethering UI Gadget Library
Name: ug-setting-mobileap-efl
Summary: Tethering UI Gadget Library
Release: 1
Group: App/Network
License: Flora-1.1
Release: 1
Group: App/Network
License: Flora-1.1
BuildRequires: pkgconfig(evas)
BuildRequires: pkgconfig(elementary)
BuildRequires: pkgconfig(ui-gadget-1)
BuildRequires: pkgconfig(evas)
BuildRequires: pkgconfig(elementary)
BuildRequires: pkgconfig(ui-gadget-1)
-BuildRequires: pkgconfig(capi-network-wifi)
+BuildRequires: pkgconfig(capi-network-wifi-manager)
BuildRequires: pkgconfig(capi-network-tethering)
BuildRequires: pkgconfig(capi-network-connection)
BuildRequires: pkgconfig(notification)
BuildRequires: pkgconfig(capi-network-tethering)
BuildRequires: pkgconfig(capi-network-connection)
BuildRequires: pkgconfig(notification)
bool wifi_state = false;
int value = 0;
bool wifi_state = false;
int value = 0;
- wifi_is_activated(&wifi_state);
+ wifi_manager_is_activated(ad->wifi_handle, &wifi_state);
_set_vconf_prev_wifi_state(wifi_state);
value = _get_checkbox_status(TETHERING_TYPE_WIFI);
if (0 == value) {
_set_vconf_prev_wifi_state(wifi_state);
value = _get_checkbox_status(TETHERING_TYPE_WIFI);
if (0 == value) {
-/* Wi-Fi callbacks */
-static void __wifi_activated_cb(wifi_error_e result, void *user_data)
-{
- DBG("+\n");
-
- return;
-}
-
/* Tethering callbacks */
void _enabled_cb(tethering_error_e result, tethering_type_e type, bool is_requested, void *user_data)
{
/* Tethering callbacks */
void _enabled_cb(tethering_error_e result, tethering_type_e type, bool is_requested, void *user_data)
{
-void _wifi_state_changed_cb(wifi_device_state_e state, void *user_data)
+void _wifi_state_changed_cb(wifi_manager_device_state_e state, void *user_data)
{
if (user_data == NULL) {
ERR("user_data is NULL\n");
{
if (user_data == NULL) {
ERR("user_data is NULL\n");
mh_appdata_t *ad = (mh_appdata_t *)user_data;
char *str = NULL;
char *fmt = NULL;
mh_appdata_t *ad = (mh_appdata_t *)user_data;
char *str = NULL;
char *fmt = NULL;
- if (state == WIFI_DEVICE_STATE_ACTIVATED) {
+ if (state == WIFI_MANAGER_DEVICE_STATE_ACTIVATED) {
if (ad->main.wifi_item && elm_object_item_disabled_get(ad->main.wifi_item))
elm_object_item_disabled_set(ad->main.wifi_item, EINA_FALSE);
_set_vconf_prev_wifi_state(false);
if (ad->main.wifi_item && elm_object_item_disabled_get(ad->main.wifi_item))
elm_object_item_disabled_set(ad->main.wifi_item, EINA_FALSE);
_set_vconf_prev_wifi_state(false);
- } else if (state == WIFI_DEVICE_STATE_DEACTIVATED) {
+ } else if (state == WIFI_MANAGER_DEVICE_STATE_DEACTIVATED) {
_set_vconf_prev_wifi_state(true);
}
_set_vconf_prev_wifi_state(true);
}
ad->popup_checkbox = NULL;
evas_object_del(ad->popup);
ad->popup = NULL;
ad->popup_checkbox = NULL;
evas_object_del(ad->popup);
ad->popup = NULL;
- if (state == WIFI_DEVICE_STATE_ACTIVATED)
+ if (state == WIFI_MANAGER_DEVICE_STATE_ACTIVATED)
fmt = STR_TETH_ON_DESC_1;
else
fmt = STR_TETH_ON_DESC_2;
fmt = STR_TETH_ON_DESC_1;
else
fmt = STR_TETH_ON_DESC_2;
-int _turn_on_wifi(void)
-{
- int ret;
-
- ret = wifi_activate(__wifi_activated_cb, NULL);
- if (ret != WIFI_ERROR_NONE) {
- ERR("wifi_activate() is failed : %d\n", ret);
- return -1;
- }
-
- return 0;
-}
-
bool _is_wifi_direct_on(void)
{
int wifi_direct_state = 0;
bool _is_wifi_direct_on(void)
{
int wifi_direct_state = 0;
-static void __set_callbacks(tethering_h handle, void *user_data)
+static void __set_callbacks(mh_appdata_t *ad, void *user_data)
- ret = tethering_set_enabled_cb(handle, TETHERING_TYPE_ALL,
+ ret = tethering_set_enabled_cb(ad->handle, TETHERING_TYPE_ALL,
_enabled_cb, user_data);
if (ret != TETHERING_ERROR_NONE)
ERR("tethering_set_enabled_cb [0x%X]\n", ret);
_enabled_cb, user_data);
if (ret != TETHERING_ERROR_NONE)
ERR("tethering_set_enabled_cb [0x%X]\n", ret);
- ret = tethering_wifi_set_passphrase_changed_cb(handle,
+ ret = tethering_wifi_set_passphrase_changed_cb(ad->handle,
_passphrase_changed_cb, user_data);
if (ret != TETHERING_ERROR_NONE)
ERR("tethering_wifi_set_passphrase_changed_cb [0x%X]\n", ret);
_passphrase_changed_cb, user_data);
if (ret != TETHERING_ERROR_NONE)
ERR("tethering_wifi_set_passphrase_changed_cb [0x%X]\n", ret);
- ret = tethering_wifi_set_ssid_visibility_changed_cb(handle,
+ ret = tethering_wifi_set_ssid_visibility_changed_cb(ad->handle,
_visibility_changed_cb, user_data);
if (ret != TETHERING_ERROR_NONE)
ERR("tethering_wifi_set_ssid_visibility_changed_cb [0x%X]\n", ret);
_visibility_changed_cb, user_data);
if (ret != TETHERING_ERROR_NONE)
ERR("tethering_wifi_set_ssid_visibility_changed_cb [0x%X]\n", ret);
- ret = tethering_wifi_set_security_type_changed_cb(handle,
+ ret = tethering_wifi_set_security_type_changed_cb(ad->handle,
_security_type_changed_cb, user_data);
if (ret != TETHERING_ERROR_NONE)
ERR("tethering_wifi_set_security_type_changed_cb [0x%X]\n", ret);
_security_type_changed_cb, user_data);
if (ret != TETHERING_ERROR_NONE)
ERR("tethering_wifi_set_security_type_changed_cb [0x%X]\n", ret);
- ret = tethering_set_disabled_cb(handle, TETHERING_TYPE_ALL,
+ ret = tethering_set_disabled_cb(ad->handle, TETHERING_TYPE_ALL,
_disabled_cb, user_data);
if (ret != TETHERING_ERROR_NONE)
ERR("tethering_set_disabled_cb [0x%X]\n", ret);
_disabled_cb, user_data);
if (ret != TETHERING_ERROR_NONE)
ERR("tethering_set_disabled_cb [0x%X]\n", ret);
- ret = tethering_set_connection_state_changed_cb(handle,
+ ret = tethering_set_connection_state_changed_cb(ad->handle,
TETHERING_TYPE_ALL,
_connection_changed_cb, user_data);
if (ret != TETHERING_ERROR_NONE)
ERR("tethering_set_connection_state_changed_cb [0x%X]\n", ret);
TETHERING_TYPE_ALL,
_connection_changed_cb, user_data);
if (ret != TETHERING_ERROR_NONE)
ERR("tethering_set_connection_state_changed_cb [0x%X]\n", ret);
- ret = wifi_set_device_state_changed_cb(_wifi_state_changed_cb, user_data);
- if (ret != WIFI_ERROR_NONE)
- ERR("wifi_set_device_state_changed_cb [0x%X]\n", ret);
+ ret = wifi_manager_set_device_state_changed_cb(ad->wifi_handle,
+ _wifi_state_changed_cb, user_data);
+ if (ret != WIFI_MANAGER_ERROR_NONE)
+ ERR("wifi_manager_set_device_state_changed_cb [0x%X]\n", ret);
vconf_notify_key_changed(VCONFKEY_SETAPPL_DEVICE_NAME_STR,
_device_name_changed_cb, user_data);
vconf_notify_key_changed(VCONFKEY_SETAPPL_DEVICE_NAME_STR,
_device_name_changed_cb, user_data);
-static void __unset_callbacks(tethering_h handle)
+static void __unset_callbacks(mh_appdata_t *ad)
- ret = wifi_unset_device_state_changed_cb();
- if (ret != WIFI_ERROR_NONE)
- ERR("wifi_unset_device_state_changed_cb [0x%X]\n", ret);
+ ret = wifi_manager_unset_device_state_changed_cb(ad->wifi_handle);
+ if (ret != WIFI_MANAGER_ERROR_NONE)
+ ERR("wifi_manager_unset_device_state_changed_cb [0x%X]\n", ret);
- ret = tethering_unset_connection_state_changed_cb(handle,
+ ret = tethering_unset_connection_state_changed_cb(ad->handle,
TETHERING_TYPE_ALL);
if (ret != TETHERING_ERROR_NONE)
ERR("tethering_unset_connection_state_changed_cb[0x%X]\n", ret);
TETHERING_TYPE_ALL);
if (ret != TETHERING_ERROR_NONE)
ERR("tethering_unset_connection_state_changed_cb[0x%X]\n", ret);
- ret = tethering_unset_disabled_cb(handle, TETHERING_TYPE_ALL);
+ ret = tethering_unset_disabled_cb(ad->handle, TETHERING_TYPE_ALL);
if (ret != TETHERING_ERROR_NONE)
ERR("tethering_unset_disabled_cb [0x%X]\n", ret);
if (ret != TETHERING_ERROR_NONE)
ERR("tethering_unset_disabled_cb [0x%X]\n", ret);
- ret = tethering_wifi_unset_security_type_changed_cb(handle);
+ ret = tethering_wifi_unset_security_type_changed_cb(ad->handle);
if (ret != TETHERING_ERROR_NONE)
ERR("tethering_wifi_unset_security_type_changed_cb [0x%X]\n", ret);
if (ret != TETHERING_ERROR_NONE)
ERR("tethering_wifi_unset_security_type_changed_cb [0x%X]\n", ret);
- ret = tethering_wifi_unset_ssid_visibility_changed_cb(handle);
+ ret = tethering_wifi_unset_ssid_visibility_changed_cb(ad->handle);
if (ret != TETHERING_ERROR_NONE)
ERR("tethering_wifi_unset_ssid_visibility_changed_cb [0x%X]\n", ret);
if (ret != TETHERING_ERROR_NONE)
ERR("tethering_wifi_unset_ssid_visibility_changed_cb [0x%X]\n", ret);
- ret = tethering_wifi_unset_passphrase_changed_cb(handle);
+ ret = tethering_wifi_unset_passphrase_changed_cb(ad->handle);
if (ret != TETHERING_ERROR_NONE)
ERR("tethering_wifi_unset_passphrase_changed_cb [0x%X]\n", ret);
if (ret != TETHERING_ERROR_NONE)
ERR("tethering_wifi_unset_passphrase_changed_cb [0x%X]\n", ret);
- ret = tethering_unset_enabled_cb(handle, TETHERING_TYPE_ALL);
+ ret = tethering_unset_enabled_cb(ad->handle, TETHERING_TYPE_ALL);
if (ret != TETHERING_ERROR_NONE)
ERR("tethering_unset_enabled [0x%X]\n", ret);
if (ret != TETHERING_ERROR_NONE)
ERR("tethering_unset_enabled [0x%X]\n", ret);
if (ret != CONNECTION_ERROR_NONE)
ERR("connection_create() is failed : %d\n", ret);
if (ret != CONNECTION_ERROR_NONE)
ERR("connection_create() is failed : %d\n", ret);
- ret = wifi_initialize();
- if (ret != WIFI_ERROR_NONE)
- ERR("wifi_initialize() is failed : %d\n", ret);
+ ret = wifi_manager_initialize(&ad->wifi_handle);
+ if (ret != WIFI_MANAGER_ERROR_NONE)
+ ERR("wifi_manager_initialize() is failed : %d\n", ret);
- __set_callbacks(ad->handle, (void *)ad);
+ __set_callbacks(ad, (void *)ad);
DBG("-\n");
return layout;
DBG("-\n");
return layout;
if (vconf_set_int(VCONF_MOBILE_AP_CONNECT_USB_POPUP_STATUS, 0) < 0)
ERR("vconf_set_int is failed\n");
if (vconf_set_int(VCONF_MOBILE_AP_CONNECT_USB_POPUP_STATUS, 0) < 0)
ERR("vconf_set_int is failed\n");
- ret = wifi_deinitialize();
- if (ret != WIFI_ERROR_NONE)
- ERR("wifi_deinitialize() is failed : %d\n", ret);
+ ret = wifi_manager_deinitialize(ad->wifi_handle);
+ if (ret != WIFI_MANAGER_ERROR_NONE)
+ ERR("wifi_manager_deinitialize() is failed : %d\n", ret);
ret = connection_destroy(ad->conn_handle);
if (ret != CONNECTION_ERROR_NONE)
ret = connection_destroy(ad->conn_handle);
if (ret != CONNECTION_ERROR_NONE)
switch (ad->type) {
case TETHERING_TYPE_WIFI:
switch (ad->type) {
case TETHERING_TYPE_WIFI:
- wifi_is_activated(&wifi_state);
+ wifi_manager_is_activated(ad->wifi_handle, &wifi_state);
_set_vconf_prev_wifi_state(wifi_state);
if (wifi_state == true || _is_wifi_direct_on() == true)
fmt = STR_TETH_ON_DESC_1;
_set_vconf_prev_wifi_state(wifi_state);
if (wifi_state == true || _is_wifi_direct_on() == true)
fmt = STR_TETH_ON_DESC_1;