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) {
return;
}
-/* 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)
{
return;
}
-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");
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);
- } else if (state == WIFI_DEVICE_STATE_DEACTIVATED) {
+ } else if (state == WIFI_MANAGER_DEVICE_STATE_DEACTIVATED) {
_set_vconf_prev_wifi_state(true);
}
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;
return 0;
}
-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;
return ad->naviframe;
}
-static void __set_callbacks(tethering_h handle, void *user_data)
+static void __set_callbacks(mh_appdata_t *ad, void *user_data)
{
DBG("+\n");
int ret;
- 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);
- 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);
- 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);
- 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);
- 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);
- 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);
- 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);
DBG("-\n");
}
-static void __unset_callbacks(tethering_h handle)
+static void __unset_callbacks(mh_appdata_t *ad)
{
DBG("+\n");
int ret;
- 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);
- 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);
- 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);
- 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);
- 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);
- 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 != 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;
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)