}
res = net_deregister_client();
- if (res != NET_ERR_NONE) {
+ if (res != NET_ERR_NONE)
DBG(LOG_ERROR, "Failed to deregister network client. [%d]\n", res);
- }
__FUNC_EXIT__;
}
bool is_wifi_enabled = false;
if (error != TETHERING_ERROR_NONE) {
- if (is_requested != TRUE) {
+ if (is_requested != TRUE)
return;
- }
DBG(LOG_ERROR, "error !!! TETHERING is not enabled.\n");
return;
th = ugd->hotspot_handle;
if (th != NULL) {
is_wifi_enabled = tethering_is_enabled(th, TETHERING_TYPE_WIFI);
- if (is_wifi_enabled) {
+ if (is_wifi_enabled)
DBG(LOG_INFO, "Mobile hotspot is activated\n");
- }
/* Deregister cbs */
ret = tethering_unset_enabled_cb(th, TETHERING_TYPE_WIFI);
- if (ret != TETHERING_ERROR_NONE) {
+ if (ret != TETHERING_ERROR_NONE)
DBG(LOG_ERROR, "tethering_unset_enabled_cb is failed(%d)\n", ret);
- }
/* Destroy tethering handle */
ret = tethering_destroy(th);
- if (ret != TETHERING_ERROR_NONE) {
+ if (ret != TETHERING_ERROR_NONE)
DBG(LOG_ERROR, "tethering_destroy is failed(%d)\n", ret);
- }
ugd->hotspot_handle = NULL;
}
bool is_wifi_enabled = false;
if (error != TETHERING_ERROR_NONE) {
- if (code != TETHERING_DISABLED_BY_REQUEST) {
+ if (code != TETHERING_DISABLED_BY_REQUEST)
return;
- }
DBG(LOG_ERROR, "error !!! TETHERING is not disabled.\n");
return;
wfd_client_swtch_force(ugd, TRUE);
ret = tethering_unset_disabled_cb(th, TETHERING_TYPE_WIFI);
- if (ret != TETHERING_ERROR_NONE) {
+ if (ret != TETHERING_ERROR_NONE)
DBG(LOG_ERROR, "tethering_unset_disabled_cb is failed(%d)\n", ret);
- }
/* Destroy tethering handle */
ret = tethering_destroy(th);
- if (ret != TETHERING_ERROR_NONE) {
+ if (ret != TETHERING_ERROR_NONE)
DBG(LOG_ERROR, "tethering_destroy is failed(%d)\n", ret);
- }
ugd->hotspot_handle = NULL;
}
if (ugd->multi_connect_mode == WFD_MULTI_CONNECT_MODE_IN_PROGRESS) {
for (i = 0; i < ugd->raw_multi_selected_peer_cnt; i++) {
- if (!strncmp(mac_addr, (const char *)ugd->raw_multi_selected_peers[i].mac_addr, MAC_LENGTH)) {
+ if (!strncmp(mac_addr, (const char *)ugd->raw_multi_selected_peers[i].mac_addr, MAC_LENGTH))
return &ugd->raw_multi_selected_peers[i];
- }
}
} else {
for (iterator = ugd->raw_discovered_peer_list; iterator; iterator = iterator->next) {
- if (!strncmp(mac_addr, ((device_type_s *)iterator->data)->mac_addr, MAC_LENGTH)) {
+ if (!strncmp(mac_addr, ((device_type_s *)iterator->data)->mac_addr, MAC_LENGTH))
return (device_type_s *)iterator->data;
- }
}
}
/* Get the device from peer list */
for (iterator = ugd->raw_discovered_peer_list; iterator; iterator = iterator->next) {
- if (!strncmp(mac_addr, ((device_type_s *)iterator->data)->mac_addr, MAC_LENGTH)) {
+ if (!strncmp(mac_addr, ((device_type_s *)iterator->data)->mac_addr, MAC_LENGTH))
return (device_type_s *)iterator->data;
- }
}
__FUNC_EXIT__;
switch (device_state) {
case WIFI_DIRECT_DEVICE_STATE_ACTIVATED:
DBG(LOG_INFO, "WIFI_DIRECT_DEVICE_STATE_ACTIVATED\n");
- if(ugd->scan_toolbar == NULL) {
+ if (ugd->scan_toolbar == NULL)
scan_button_create(ugd);
- }
+
if (error_code != WIFI_DIRECT_ERROR_NONE) {
DBG(LOG_ERROR, "Error in Activation/Deactivation [%d]\n", error_code);
- if (WIFI_DIRECT_ERROR_AUTH_FAILED == error_code) {
+ if (WIFI_DIRECT_ERROR_AUTH_FAILED == error_code)
wfd_ug_warn_popup(ugd, D_("IDS_COM_POP_SECURITY_POLICY_RESTRICTS_USE_OF_WI_FI"), POPUP_TYPE_ACTIVATE_FAIL_POLICY_RESTRICTS);
- } else {
+ else
wfd_ug_warn_popup(ugd, D_("IDS_COM_POP_FAILED"), POPUP_TYPE_ACTIVATE_FAIL);
- }
#ifdef WFD_ON_OFF_GENLIST
ugd->wfd_onoff = 0;
#ifndef MODEL_BUILD_FEATURE_WLAN_CONCURRENT_MODE
res = vconf_ignore_key_changed(VCONFKEY_WIFI_STATE, _wifi_state_cb);
- if (res == -1) {
+ if (res == -1)
DBG(LOG_ERROR, "Failed to ignore vconf key callback for wifi state\n");
- }
#endif /* MODEL_BUILD_FEATURE_WLAN_CONCURRENT_MODE */
ugd->wfd_discovery_status = WIFI_DIRECT_DISCOVERY_SOCIAL_CHANNEL_START;
WFD_IF_DEL_ITEM(ugd->multi_connect_toolbar_item);
- if (ugd->ctxpopup) {
+ if (ugd->ctxpopup)
ctxpopup_dismissed_cb(ugd, NULL, NULL);
- }
/*
* When multi-connect is on ongoing and deactivte happened destroy
/* Delete warn popups for Airplane mode */
if (NULL != ugd->warn_popup) {
- evas_object_del( ugd->warn_popup);
+ evas_object_del(ugd->warn_popup);
ugd->warn_popup = NULL;
}
* discovered peers and connected peers
*/
wfd_client_free_raw_discovered_peers(ugd);
- if (ugd->raw_connected_peer_cnt > 0) {
+ if (ugd->raw_connected_peer_cnt > 0)
memset(ugd->raw_connected_peers, 0x00, ugd->raw_connected_peer_cnt*sizeof(device_type_s));
- }
ugd->raw_discovered_peer_cnt = 0;
ugd->raw_connected_peer_cnt = 0;
wfd_free_nodivice_item(ugd);
wfd_ug_view_init_genlist(ugd, true);
- if (ugd->multi_navi_item != NULL) {
+ if (ugd->multi_navi_item != NULL)
elm_naviframe_item_pop(ugd->naviframe);
- }
if (TRUE == ugd->is_hotspot_off && TRUE == ugd->is_hotspot_locally_disabled) {
- if (0 == wfd_mobile_ap_on(ugd)) {
+ if (0 == wfd_mobile_ap_on(ugd))
ugd->is_hotspot_locally_disabled = FALSE;
- }
}
- if(ugd->scan_toolbar) {
+ if (ugd->scan_toolbar) {
evas_object_del(ugd->scan_toolbar);
ugd->scan_toolbar = NULL;
}
break;
}
- /*if (ugd->scan_toolbar) {
+ /*if (ugd->scan_toolbar)
wfd_ug_view_refresh_button(ugd->scan_toolbar, D_("IDS_WIFI_SK4_SCAN"), TRUE);
- }*/
+ */
- if (ugd->multiconn_scan_stop_btn) {
+ if (ugd->multiconn_scan_stop_btn)
wfd_ug_view_refresh_button(ugd->multiconn_scan_stop_btn, "IDS_WIFI_SK4_SCAN", TRUE);
- }
- if (ugd->back_btn) {
+ if (ugd->back_btn)
elm_object_disabled_set(ugd->back_btn, FALSE);
- }
__FUNC_EXIT__;
return;
peer_tmp->is_connected = peer->is_connected;
peer_tmp->dev_sel_state = FALSE;
- if (TRUE == peer->is_connected) {
+ if (TRUE == peer->is_connected)
peer_tmp->conn_status = PEER_CONN_STATUS_CONNECTED;
- } else {
+ else
peer_tmp->conn_status = PEER_CONN_STATUS_DISCONNECTED;
- }
ugd->raw_discovered_peer_list = g_list_append(ugd->raw_discovered_peer_list, peer_tmp);
DBG(LOG_INFO, "\tSSID: [%s]\n", peer_tmp->ssid);
WFD_IF_FREE_MEM(peer->mac_address);
WFD_IF_FREE_MEM(peer->interface_address);
- if (NULL != peer->service_list)
- {
- for (i=0; i<peer->service_count && peer->service_list[i] != NULL; i++) {
+ if (NULL != peer->service_list) {
+ for (i = 0; i < peer->service_count && peer->service_list[i] != NULL; i++)
free(peer->service_list[i]);
- }
+
WFD_IF_FREE_MEM(peer->service_list);
}
char services[256] = {0,};
DBG(LOG_INFO, "\tservice_count: [%d]\n", peer->service_count);
- if (peer->service_count>0) {
+ if (peer->service_count > 0) {
unsigned int len = 0;
- for (i=0; i<peer->service_count && peer->service_list != NULL; i++) {
+ for (i = 0; i < peer->service_count && peer->service_list != NULL; i++) {
snprintf(services + len, 256-len, "%s ", peer->service_list[i]);
len = len + strlen(peer->service_list[i]) + 1;
}
return FALSE;
}
- if(peer->ip_address != NULL && strlen(services) != 0 ) {
+ if (peer->ip_address != NULL && strlen(services) != 0) {
app_control_add_extra_data(control, "ip_address", peer->ip_address);
app_control_add_extra_data(control, "wfds", services);
ug_send_result(ugd->ug, control);
WFD_IF_FREE_MEM(peer->mac_address);
WFD_IF_FREE_MEM(peer->interface_address);
- if (NULL != peer->service_list)
- {
- for (i=0; i<peer->service_count && peer->service_list[i] != NULL; i++) {
+ if (NULL != peer->service_list) {
+ for (i = 0; i < peer->service_count && peer->service_list[i] != NULL; i++)
free(peer->service_list[i]);
- }
+
WFD_IF_FREE_MEM(peer->service_list);
}
ugd->mac_addr_connecting = mac_addr;
for (iterator = ugd->raw_discovered_peer_list; iterator; iterator = iterator->next) {
- if (!strncmp(mac_addr, ((device_type_s *)iterator->data)->mac_addr, MAC_LENGTH)) {
+ if (!strncmp(mac_addr, ((device_type_s *)iterator->data)->mac_addr, MAC_LENGTH))
((device_type_s *)iterator->data)->conn_status = PEER_CONN_STATUS_CONNECTING;
- }
}
wfd_ug_view_refresh_glitem(ugd->mcview_title_item);
wfd_ug_view_refresh_glitem(ugd->avlbl_wfd_item);
- if (0 == ugd->gl_available_dev_cnt_at_multiconn_view) {
+ if (0 == ugd->gl_available_dev_cnt_at_multiconn_view)
_create_no_device_multiconnect_genlist(ugd);
- }
wfd_refresh_wifi_direct_state(ugd);
if (WIFI_DIRECT_STATE_CONNECTING != ugd->wfd_status &&
return;
}
- if (ugd->multi_connect_mode == WFD_MULTI_CONNECT_MODE_IN_PROGRESS) {
+ if (ugd->multi_connect_mode == WFD_MULTI_CONNECT_MODE_IN_PROGRESS)
return;
- }
DBG(LOG_INFO, "Discovery event [%d], error_code [%d]\n", discovery_state, error_code);
ugd->raw_discovered_peer_cnt = 0;
wfd_ug_view_init_genlist(ugd, false);
- if (ugd->avlbl_wfd_item == NULL) {
+ if (ugd->avlbl_wfd_item == NULL)
_create_available_dev_genlist(ugd);
- }
wfd_ug_view_refresh_glitem(ugd->mcview_title_item);
/* clear not alive peers after 5 secs */
if (WIFI_DIRECT_DISCOVERY_STARTED == discovery_state &&
ugd->wfd_discovery_status == WIFI_DIRECT_DISCOVERY_SOCIAL_CHANNEL_START) {
WFD_IF_DEL_ITEM(ugd->multi_connect_toolbar_item);
- if (!ugd->conn_wfd_item) {
+ if (!ugd->conn_wfd_item)
elm_layout_content_set(ugd->button_layout, "button.big", ugd->scan_toolbar);
- }
+
wfd_ug_view_refresh_button(ugd->scan_toolbar, "IDS_WIFI_SK_STOP", TRUE);
- if (ugd->multiconn_scan_stop_btn) {
+ if (ugd->multiconn_scan_stop_btn)
wfd_ug_view_refresh_button(ugd->multiconn_scan_stop_btn, "IDS_WIFI_SK_STOP", TRUE);
- }
}
__FUNC_EXIT__;
} else {
peer->conn_status = PEER_CONN_STATUS_FAILED_TO_CONNECT;
peer = find_peer_in_glist(ugd->gl_mul_conn_peers_start, peer->mac_addr);
- if ( peer != NULL) {
+ if (peer != NULL) {
peer->conn_status = PEER_CONN_STATUS_FAILED_TO_CONNECT;
wfd_ug_view_refresh_glitem(peer->gl_item);
}
peer->conn_status = PEER_CONN_STATUS_CONNECTING;
peer = find_peer_in_glist(ugd->gl_mul_conn_peers_start, peer->mac_addr);
- if ( peer != NULL) {
+ if (peer != NULL) {
peer->conn_status = PEER_CONN_STATUS_CONNECTING;
wfd_ug_view_refresh_glitem(peer->gl_item);
}
wfd_ug_get_connected_peers(ugd);
/* when auto_exit and not multi-connect*/
- if ((ugd->is_auto_exit)&&(ugd->multi_connect_mode == WFD_MULTI_CONNECT_MODE_NONE)) {
+ if ((ugd->is_auto_exit) && (ugd->multi_connect_mode == WFD_MULTI_CONNECT_MODE_NONE))
_wfd_ug_auto_exit(ugd);
- }
wfd_ug_update_connected_peers(ugd);
} else {
wfd_ug_view_refresh_button(ugd->scan_toolbar, "IDS_WIFI_SK4_SCAN", TRUE);
/* change the multi connection mode, it can be connected now */
- if (ugd->multi_connect_mode == WFD_MULTI_CONNECT_MODE_COMPLETED) {
+ if (ugd->multi_connect_mode == WFD_MULTI_CONNECT_MODE_COMPLETED)
ugd->multi_connect_mode = WFD_MULTI_CONNECT_MODE_NONE;
- }
/* if other peer disconnected, get connected peers and update */
peer->conn_status = PEER_CONN_STATUS_DISCONNECTED;
evas_object_hide(content);
/* when disconnection, clear all the connected peers */
- if (ugd->raw_connected_peer_cnt > 0) {
+ if (ugd->raw_connected_peer_cnt > 0)
memset(ugd->raw_connected_peers, 0x00, ugd->raw_connected_peer_cnt*sizeof(device_type_s));
- }
ugd->raw_connected_peer_cnt = 0;
wfd_ug_view_init_genlist(ugd, true);
wfd_cancel_progressbar_stop_timer(ugd);
wfd_delete_progressbar_cb(ugd);
- if (ugd->multi_navi_item) {
+ if (ugd->multi_navi_item)
elm_naviframe_item_pop(ugd->naviframe);
- }
ugd->mac_addr_connecting = peer->mac_addr;
ugd->is_conn_incoming = FALSE;
res = wifi_direct_is_group_owner(&owner);
if (res == WIFI_DIRECT_ERROR_NONE) {
if (!owner) {
- if (ugd->scan_toolbar) {
+ if (ugd->scan_toolbar)
evas_object_data_set(ugd->toolbar, "scan", "scan");
- }
- if (ugd->multiconn_scan_stop_btn) {
+ if (ugd->multiconn_scan_stop_btn)
wfd_ug_view_refresh_button(ugd->multiconn_scan_stop_btn, "IDS_WIFI_SK4_SCAN", FALSE);
- }
}
} else {
DBG(LOG_ERROR, "Failed to get whether client is group owner. [%d]\n", res);
}
} else {
- if (ugd->scan_toolbar) {
+ if (ugd->scan_toolbar)
evas_object_data_set(ugd->toolbar, "scan", "scan");
- }
- if (ugd->multiconn_scan_stop_btn) {
+ if (ugd->multiconn_scan_stop_btn)
wfd_ug_view_refresh_button(ugd->multiconn_scan_stop_btn, "IDS_WIFI_SK4_SCAN", TRUE);
- }
}
__FUNC_EXIT__;
struct ug_data *ugd = (struct ug_data *)user_data;
if (!ip_address || 0 == strncmp(ip_address, "0.0.0.0", 7)) {
- DBG(LOG_ERROR,"ip address is invalid.\n");
+ DBG(LOG_ERROR, "ip address is invalid.\n");
return;
}
app_control_destroy(control);
/* when auto_exit and not multi-connect*/
- if ((ugd->is_auto_exit)&&(ugd->multi_connect_mode == WFD_MULTI_CONNECT_MODE_NONE)) {
+ if ((ugd->is_auto_exit) && (ugd->multi_connect_mode == WFD_MULTI_CONNECT_MODE_NONE))
_wfd_ug_auto_exit(ugd);
- }
__FUNC_EXIT__;
}
struct ug_data *ugd = (struct ug_data *)user_data;
int res = 0;
- if(ugd == NULL) {
+ if (ugd == NULL) {
DBG(LOG_ERROR, "Incorrect parameter(NULL)\n");
return;
}
g_object_unref(ugd->dbus_cancellable);
ugd->dbus_cancellable = NULL;
- ugd->conn = G_DBUS_CONNECTION (source_object);
+ ugd->conn = G_DBUS_CONNECTION(source_object);
return_data = g_dbus_connection_call_finish(ugd->conn, result, &error);
if (error != NULL) {
- DBG(LOG_ERROR,"DBus action failed. Error Msg [%s]\n", error->message);
+ DBG(LOG_ERROR, "DBus action failed. Error Msg [%s]\n", error->message);
g_clear_error(&error);
} else {
DBG(LOG_INFO, "error msg is NULL\n");
addr = g_dbus_address_get_for_bus_sync(G_BUS_TYPE_SYSTEM, NULL, &error);
WFD_RETV_IF(addr == NULL, -1, "Fail to get dbus addr.\n");
- ugd->conn = g_dbus_connection_new_for_address_sync(addr,G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_CLIENT |
+ ugd->conn = g_dbus_connection_new_for_address_sync(addr, G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_CLIENT |
G_DBUS_CONNECTION_FLAGS_MESSAGE_BUS_CONNECTION, NULL, NULL, NULL);
- if(ugd->conn == NULL) {
- DBG(LOG_ERROR,"g_dbus_conn is NULL\n");
+ if (ugd->conn == NULL) {
+ DBG(LOG_ERROR, "g_dbus_conn is NULL\n");
return -1;
} else {
- g_dbus_connection_call(ugd->conn, "net.netconfig", "/net/netconfig/wifi","net.netconfig.wifi",
+ g_dbus_connection_call(ugd->conn, "net.netconfig", "/net/netconfig/wifi", "net.netconfig.wifi",
"LaunchDirect", NULL, NULL, G_DBUS_CALL_FLAGS_NONE, -1, ugd->dbus_cancellable, wfd_gdbus_callback, data);
}
if (ugd->hotspot_handle != NULL) {
/* Deregister cbs */
ret = tethering_unset_enabled_cb(ugd->hotspot_handle, TETHERING_TYPE_WIFI);
- if (ret != TETHERING_ERROR_NONE) {
+ if (ret != TETHERING_ERROR_NONE)
DBG(LOG_ERROR, "tethering_unset_enabled_cb is failed(%d)\n", ret);
- }
ret = tethering_unset_disabled_cb(ugd->hotspot_handle, TETHERING_TYPE_WIFI);
- if (ret != TETHERING_ERROR_NONE) {
+ if (ret != TETHERING_ERROR_NONE)
DBG(LOG_ERROR, "tethering_unset_disabled_cb is failed(%d)\n", ret);
- }
/* Destroy tethering handle */
ret = tethering_destroy(ugd->hotspot_handle);
- if (ret != TETHERING_ERROR_NONE) {
+ if (ret != TETHERING_ERROR_NONE)
DBG(LOG_ERROR, "tethering_destroy is failed(%d)\n", ret);
- }
ugd->hotspot_handle = NULL;
}
wfd_cancel_progressbar_stop_timer(ugd);
wfd_cancel_not_alive_delete_timer(ugd);
- if(ugd->timer_multi_reset > 0) {
+ if (ugd->timer_multi_reset > 0)
g_source_remove(ugd->timer_multi_reset);
- }
+
ugd->timer_multi_reset = 0;
- if (ugd->g_source_multi_connect_next > 0) {
+ if (ugd->g_source_multi_connect_next > 0)
g_source_remove(ugd->g_source_multi_connect_next);
- }
+
ugd->g_source_multi_connect_next = 0;
res = wifi_direct_unset_discovery_state_changed_cb();
- if (res != WIFI_DIRECT_ERROR_NONE) {
- DBG(LOG_ERROR, "Failed to unset discovery state changed cb. [%d]\n", res);
- }
+ if (res != WIFI_DIRECT_ERROR_NONE)
+ DBG(LOG_ERROR, "Failed to unset discovery state changed cb. [%d]\n", res);
wifi_direct_unset_device_state_changed_cb();
- if (res != WIFI_DIRECT_ERROR_NONE) {
- DBG(LOG_ERROR, "Failed to unset device state changed cb. [%d]\n", res);
- }
+ if (res != WIFI_DIRECT_ERROR_NONE)
+ DBG(LOG_ERROR, "Failed to unset device state changed cb. [%d]\n", res);
wifi_direct_unset_connection_state_changed_cb();
- if (res != WIFI_DIRECT_ERROR_NONE) {
- DBG(LOG_ERROR, "Failed to unset connection state changed cb. [%d]\n", res);
- }
+ if (res != WIFI_DIRECT_ERROR_NONE)
+ DBG(LOG_ERROR, "Failed to unset connection state changed cb. [%d]\n", res);
wifi_direct_unset_client_ip_address_assigned_cb();
- if (res != WIFI_DIRECT_ERROR_NONE) {
- DBG(LOG_ERROR, "Failed to unset client ip address assigned cb. [%d]\n", res);
- }
+ if (res != WIFI_DIRECT_ERROR_NONE)
+ DBG(LOG_ERROR, "Failed to unset client ip address assigned cb. [%d]\n", res);
if (ugd->wfd_status == WIFI_DIRECT_STATE_CONNECTING &&
NULL != ugd->mac_addr_connecting) {
if (ugd->is_conn_incoming) {
DBG(LOG_INFO, "Reject the incoming connection before client deregister \n");
res = wifi_direct_reject_connection(ugd->mac_addr_connecting);
- if (res != WIFI_DIRECT_ERROR_NONE) {
+ if (res != WIFI_DIRECT_ERROR_NONE)
DBG(LOG_ERROR, "Failed to send reject request [%d]\n", res);
- }
} else {
DBG(LOG_INFO, "Cancel the outgoing connection before client deregister \n");
res = wifi_direct_cancel_connection(ugd->mac_addr_connecting);
- if (res != WIFI_DIRECT_ERROR_NONE) {
+ if (res != WIFI_DIRECT_ERROR_NONE)
DBG(LOG_ERROR, "Failed to send cancel request [%d]\n", res);
- }
}
ugd->mac_addr_connecting = NULL;
}
res = wifi_direct_deinitialize();
- if (res != WIFI_DIRECT_ERROR_NONE) {
+ if (res != WIFI_DIRECT_ERROR_NONE)
DBG(LOG_ERROR, "Failed to deregister client. [%d]\n", res);
- }
/* release vconf, hotspot.. */
#ifndef MODEL_BUILD_FEATURE_WLAN_CONCURRENT_MODE
res = vconf_ignore_key_changed(VCONFKEY_WIFI_STATE, _wifi_state_cb);
- if (res == -1) {
+ if (res == -1)
DBG(LOG_ERROR, "Failed to ignore vconf key callback for wifi state\n");
- }
res = net_deregister_client();
- if (res != NET_ERR_NONE) {
+ if (res != NET_ERR_NONE)
DBG(LOG_ERROR, "Failed to deregister network client. [%d]\n", res);
- }
+
#endif /* MODEL_BUILD_FEATURE_WLAN_CONCURRENT_MODE */
bool is_wifi_enabled = false;
- if(!ugd->is_init_ok) {
+ if (!ugd->is_init_ok) {
DBG(LOG_ERROR, "device is initializing, please wait\n");
return -1;
}
if (is_wifi_enabled) {
DBG(LOG_INFO, "WiFi is connected, so have to turn off WiFi");
wfd_ug_act_popup(ugd, D_("IDS_WIFI_BODY_USING_WI_FI_DIRECT_WILL_DISCONNECT_CURRENT_WI_FI_TETHERING_CONTINUE_Q"), POPUP_TYPE_HOTSPOT_OFF);
- } else
-
- {
+ } else {
res = wifi_direct_activate();
if (res != WIFI_DIRECT_ERROR_NONE) {
DBG(LOG_ERROR, "Failed to activate Wi-Fi Direct. error code = [%d]\n", res);
}
#endif
/* while activating, disable the buttons */
- if (ugd->scan_toolbar == NULL) {
+ if (ugd->scan_toolbar == NULL)
scan_button_create(ugd);
- }
- if (ugd->scan_toolbar) {
+ if (ugd->scan_toolbar)
wfd_ug_view_refresh_button(ugd->scan_toolbar, "IDS_WIFI_SK4_SCAN", FALSE);
- }
- if (ugd->multiconn_scan_stop_btn) {
+ if (ugd->multiconn_scan_stop_btn)
wfd_ug_view_refresh_button(ugd->multiconn_scan_stop_btn, "IDS_WIFI_SK4_SCAN", FALSE);
- }
- if (ugd->back_btn) {
+ if (ugd->back_btn)
elm_object_disabled_set(ugd->back_btn, TRUE);
- }
}
} else {
DBG(LOG_INFO, "Wi-Fi Direct is already activated\n");
wfd_cancel_progressbar_stop_timer(ugd);
wfd_cancel_not_alive_delete_timer(ugd);
- if(ugd->timer_multi_reset > 0) {
+ if (ugd->timer_multi_reset > 0)
g_source_remove(ugd->timer_multi_reset);
- }
+
ugd->timer_multi_reset = 0;
- if (ugd->g_source_multi_connect_next > 0) {
+ if (ugd->g_source_multi_connect_next > 0)
g_source_remove(ugd->g_source_multi_connect_next);
- }
+
ugd->g_source_multi_connect_next = 0;
/*if connected, disconnect all devices*/
ugd->scan_toolbar = NULL;
}
- if (ugd->multiconn_scan_stop_btn) {
+ if (ugd->multiconn_scan_stop_btn)
wfd_ug_view_refresh_button(ugd->multiconn_scan_stop_btn, "IDS_WIFI_SK4_SCAN", FALSE);
- }
- if (ugd->multi_connect_toolbar_item) {
+ if (ugd->multi_connect_toolbar_item)
elm_object_item_disabled_set(ugd->multi_connect_toolbar_item, TRUE);
- }
- if (ugd->back_btn) {
+ if (ugd->back_btn)
elm_object_disabled_set(ugd->back_btn, TRUE);
- }
}
__FUNC_EXIT__;