#define WFD_RET_IF(expr, fmt, args...) \
do { \
- if(expr) { \
- WFD_APP_LOG(WFD_APP_LOG_ERROR, "[%s] Return, message "fmt, #expr, ##args );\
+ if (expr) { \
+ WFD_APP_LOG(WFD_APP_LOG_ERROR, "[%s] Return, message "fmt, #expr, ##args);\
return; \
} \
} while (0)
#define WFD_IF_FREE_MEM(mem) \
do { \
- if(mem) { \
+ if (mem) { \
free(mem); \
mem = NULL; \
} \
#define WFD_RETV_IF(expr, val, fmt, args...) \
do { \
- if(expr) { \
- WFD_APP_LOG(WFD_APP_LOG_ERROR, "[%s] Return value, message "fmt, #expr, ##args );\
+ if (expr) { \
+ WFD_APP_LOG(WFD_APP_LOG_ERROR, "[%s] Return value, message "fmt, #expr, ##args);\
return (val); \
} \
} while (0)
/* check the timeout, if not timeout, keep the cb */
interval = time(NULL) - ad->last_wfd_transmit_time;
- if (interval < NO_ACTION_TIME_OUT) {
+ if (interval < NO_ACTION_TIME_OUT)
return ECORE_CALLBACK_RENEW;
- }
/* get transfer state */
if (vconf_get_int(VCONFKEY_WIFI_DIRECT_TRANSFER_STATE, &wfd_transfer_state) < 0) {
}
res = wifi_direct_get_state(&ad->wfd_status);
- if (res != WIFI_DIRECT_ERROR_NONE) {
+ if (res != WIFI_DIRECT_ERROR_NONE)
return ECORE_CALLBACK_CANCEL;
- }
if (ad->wfd_status < WIFI_DIRECT_STATE_CONNECTED) {
WFD_APP_LOG(WFD_APP_LOG_ERROR, "Wi-Fi Direct is unconnected!");
{
wfd_appdata_t *ad = (wfd_appdata_t *)data;
int res;
- if(NULL == ad) {
+ if (NULL == ad) {
WFD_APP_LOG(WFD_APP_LOG_ERROR, "NULL == ad!\n");
return -1;
}
res = wifi_direct_get_state(&ad->wfd_status);
- if (res != WIFI_DIRECT_ERROR_NONE) {
+ if (res != WIFI_DIRECT_ERROR_NONE)
return ECORE_CALLBACK_CANCEL;
- }
if (ad->wfd_status >= WIFI_DIRECT_STATE_ACTIVATING) {
/*if connected, disconnect all devices*/
if (WIFI_DIRECT_STATE_CONNECTED == ad->wfd_status) {
res = wifi_direct_disconnect_all();
- if (res != WIFI_DIRECT_ERROR_NONE) {
+ if (res != WIFI_DIRECT_ERROR_NONE)
return -1;
- }
}
res = wifi_direct_deactivate();
if (res != WIFI_DIRECT_ERROR_NONE) {
int screen_mirroring_status = 0;
#endif
- if (NULL == ad) {
+ if (NULL == ad)
return ECORE_CALLBACK_CANCEL;
- }
/* check the action, if action is exist, keep the cb */
res = wifi_direct_get_state(&ad->wfd_status);
/* check the timeout, if not timeout, keep the cb */
interval = time(NULL) - ad->last_wfd_time;
- if (interval < MAX_NO_ACTION_TIME_OUT) {
+ if (interval < MAX_NO_ACTION_TIME_OUT)
return ECORE_CALLBACK_RENEW;
- }
/* turn off the Wi-Fi Direct */
wifi_direct_get_state(&ad->wfd_status);
} else {
#ifdef WFD_SCREEN_MIRRORING_ENABLED
if (vconf_get_int(VCONFKEY_SCREEN_MIRRORING_STATE, &screen_mirroring_status) < 0)
- {
WFD_APP_LOG(WFD_APP_LOG_ERROR, "Failed to get vconf VCONFKEY_SCREEN_MIRRORING_STATE\n");
- }
if (screen_mirroring_status == VCONFKEY_SCREEN_MIRRORING_ACTIVATED) {
ad->last_wfd_time = time(NULL);
}
/* reset monitor timer */
- if (ad->monitor_timer) {
+ if (ad->monitor_timer)
ad->monitor_timer = NULL; //ECORE_CALLBACK_CANCEL will release timer.
- }
return ECORE_CALLBACK_CANCEL;
}
break;
}
int res = display_change_state(LCD_NORMAL);
- if(res < 0)
+ if (res < 0)
WFD_APP_LOG(WFD_APP_LOG_ERROR, "Failed to change PM state(%d)", res);
}
}
*/
/* wifi_direct_get_state(&ad->wfd_status); */
- if (vconf_get_int(VCONFKEY_WIFI_DIRECT_STATE, &wfd_state) < 0) {
+ if (vconf_get_int(VCONFKEY_WIFI_DIRECT_STATE, &wfd_state) < 0)
WFD_APP_LOG(WFD_APP_LOG_ERROR, "Error reading vconf (%s)\n", VCONFKEY_WIFI_DIRECT_STATE);
- }
+
WFD_APP_LOG(WFD_APP_LOG_LOW, "wfd state: %d", wfd_state);
- if (wfd_state == VCONFKEY_WIFI_DIRECT_DEACTIVATED) {
+ if (wfd_state == VCONFKEY_WIFI_DIRECT_DEACTIVATED)
wfd_app_util_del_notification(ad);
- }
#ifdef NOT_CONNECTED_INDICATOR_ICON
if (wfd_state >= VCONFKEY_WIFI_DIRECT_CONNECTED) {
} else {
noti_err = notification_free(ad->noti_wifi_direct_on);
ad->noti_wifi_direct_on = NULL;
- if (noti_err != NOTIFICATION_ERROR_NONE) {
+ if (noti_err != NOTIFICATION_ERROR_NONE)
WFD_APP_LOG(WFD_APP_LOG_ERROR, "Fail to notification_free.(%d)\n", noti_err);
- }
}
}
#endif
#endif
ret = wifi_direct_unset_device_state_changed_cb();
- if (ret != WIFI_DIRECT_ERROR_NONE) {
+ if (ret != WIFI_DIRECT_ERROR_NONE)
WFD_APP_LOG(WFD_APP_LOG_ERROR, "Failed to deregister _cb_activation(%d)\n", ret);
- }
ret = wifi_direct_unset_connection_state_changed_cb();
- if (ret != WIFI_DIRECT_ERROR_NONE) {
+ if (ret != WIFI_DIRECT_ERROR_NONE)
WFD_APP_LOG(WFD_APP_LOG_ERROR, "Failed to deregister _cb_connection(%d)\n", ret);
- }
ret = wifi_direct_deinitialize();
- if (ret != WIFI_DIRECT_ERROR_NONE) {
+ if (ret != WIFI_DIRECT_ERROR_NONE)
WFD_APP_LOG(WFD_APP_LOG_ERROR, "Failed to deinitialize Wi-Fi Direct. error code = [%d]\n", ret);
- }
__WFD_APP_FUNC_EXIT__;
return 0;
wfd_app_util_del_notification(ad);
ret = wfd_app_util_deregister_vconf_callbacks(ad);
- if (ret < 0) {
+ if (ret < 0)
WFD_APP_LOG(WFD_APP_LOG_ERROR, "Failed to register vconf notification");
- }
/* Deregister Hardkey CB */
wfd_app_util_deregister_hard_key_down_cb(ad);
/* Deinitializes feedback API */
ret = feedback_deinitialize();
- if (ret != FEEDBACK_ERROR_NONE) {
+ if (ret != FEEDBACK_ERROR_NONE)
WFD_APP_LOG(WFD_APP_LOG_ERROR, "feedback_deinitialize error : %d\n", ret);
- }
+
if (ad->transmit_timer) {
ecore_timer_del(ad->transmit_timer);
ad->transmit_timer = NULL;
wfd_destroy_popup();
ret = deinit_wfd_client(ad);
- if (ret < 0) {
+ if (ret < 0)
WFD_APP_LOG(WFD_APP_LOG_ERROR, "deinit_wfd_client error\n");
- }
if (ad->back_grnd) {
evas_object_del(ad->back_grnd);
app_control_set_app_id(ug_control, "setting-wifidirect-efl");
ret = app_control_send_launch_request(ug_control, NULL, NULL);
- if(ret == APP_CONTROL_ERROR_NONE) {
+ if (ret == APP_CONTROL_ERROR_NONE)
WFD_APP_LOG(WFD_APP_LOG_LOW, "Launch Wi-Fi Direct successful");
- } else {
+ else
WFD_APP_LOG(WFD_APP_LOG_ERROR, "Fail to launch Wi-Fi Direct");
- }
+
app_control_destroy(ug_control);
}
static void mouseup_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
{
Evas_Event_Mouse_Up *ev = event_info;
- if (ev->button == 3) {
+ if (ev->button == 3)
evas_object_del(obj);
- }
}
/*static void keydown_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
ad->popup_timeout_handle = 0;
}
- if (ad->win) {
+ if (ad->win)
evas_object_hide(ad->win);
- }
if (pb_timer) {
ecore_timer_del(pb_timer);
ad->popup = NULL;
}
- if (ad->win) {
+ if (ad->win)
evas_object_hide(ad->win);
- }
__WFD_APP_FUNC_EXIT__;
}
/* show the time label */
if (step < 60) {
- if (step < 10) {
+ if (step < 10)
snprintf(time_label, 32, "00:0%d", step);
- } else {
+ else
snprintf(time_label, 32, "00:%d", step);
- }
} else {
- if (step%60 < 10) {
+ if (step%60 < 10)
snprintf(time_label, 32, "0%d:0%d", step/60, step%60);
- } else {
+ else
snprintf(time_label, 32, "0%d:%d", step/60, step%60);
- }
}
char *remaining_time_str = g_strdup_printf(
return ECORE_CALLBACK_CANCEL;
}
- keypad_popup_timeout --;
+ keypad_popup_timeout--;
if (keypad_popup_timeout > 0) {
_replace_1PS_2PD((char *)msg1, sizeof(msg1),
(void *) (intptr_t) pop->resp_data2);
}
- if (pop->resp_data1 == WFD_POP_RESP_APRV_CONNECT_KEYPAD_YES || pop->resp_data1 == WFD_POP_RESP_APRV_CONNECT_PBC_YES ) {
+ if (pop->resp_data1 == WFD_POP_RESP_APRV_CONNECT_KEYPAD_YES || pop->resp_data1 == WFD_POP_RESP_APRV_CONNECT_PBC_YES) {
Evas_Object *btn1 = NULL;
btn1 = elm_button_add(popup);
elm_object_style_set(btn1, "popup");
Ecore_IMF_Context *imf_context;
imf_context = (Ecore_IMF_Context*)elm_entry_imf_context_get(entry);
- if (imf_context) {
+ if (imf_context)
ecore_imf_context_input_panel_hide(imf_context);
- }
elm_object_focus_set(entry, EINA_FALSE);
}
const char *part)
{
__WFD_APP_FUNC_ENTER__;
- if (obj == NULL || part == NULL) {
+ if (obj == NULL || part == NULL)
return NULL;
- }
+
WFD_APP_LOG(WFD_APP_LOG_LOW, "wfd_rename desc\n");
char buf[WFD_POP_STR_MAX_LEN] = {0, };
char msg1[WFD_POP_STR_MAX_LEN] = {0, };
WFD_RETV_IF(connection == NULL, NULL, "Incorrect parameter(NULL)\n");
if (!strcmp("elm.text.multiline", part)) {
- if (keypad_popup_timeout > 0) {
+ if (keypad_popup_timeout > 0)
ad->timeout = keypad_popup_timeout;
- }
+
_replace_1PS_2PD((char *)msg1, WFD_POP_STR_MAX_LEN,
D_("IDS_ST_BODY_CONNECT_WITH_PS_IN_PD_SECS_ABB"),
connection->peer_name, ad->timeout);
const char *part)
{
__WFD_APP_FUNC_ENTER__;
- if (obj == NULL || part == NULL) {
+ if (obj == NULL || part == NULL)
return NULL;
- }
+
wfd_appdata_t *ad = wfd_get_appdata();
WFD_RETV_IF(ad == NULL, NULL, "Incorrect parameter(NULL)\n");
Evas_Object *entry = NULL;
elm_entry_prediction_allow_set(entry, EINA_FALSE);
elm_entry_markup_filter_append(entry,
- elm_entry_filter_accept_set,&accept_set);
+ elm_entry_filter_accept_set, &accept_set);
elm_entry_input_panel_layout_set(entry,
ELM_INPUT_PANEL_LAYOUT_DATETIME);
elm_object_signal_emit(entry, "elm,action,hide,search_icon", "");
elm_object_domain_translatable_part_text_set(entry, "elm.guide",
PACKAGE, D_("IDS_WIFI_POP_PIN"));
- elm_entry_input_panel_return_key_autoenabled_set(entry,EINA_TRUE);
+ elm_entry_input_panel_return_key_autoenabled_set(entry, EINA_TRUE);
elm_entry_input_panel_return_key_type_set(entry,
ELM_INPUT_PANEL_RETURN_KEY_TYPE_DONE);
evas_object_smart_callback_add(button, "clicked",
__popup_eraser_clicked_cb, entry);
- elm_object_signal_emit (entry, "elm,action,hide,search_icon", "");
+ elm_object_signal_emit(entry, "elm,action,hide,search_icon", "");
evas_object_smart_callback_add(entry, "changed",
_entry_changed_cb, NULL);
evas_object_smart_callback_add(entry, "preedit,changed",
evas_object_event_callback_add(entry, EVAS_CALLBACK_KEY_DOWN,
_entry_keydown_cb, ad);
- elm_object_content_set(obj,entry);
+ elm_object_content_set(obj, entry);
evas_object_show(entry);
evas_object_smart_callback_add(entry, "changed", _smart_ime_cb, NULL);
elm_object_focus_set(entry, EINA_TRUE);
static void _chk_changed_cb(void *data, Evas_Object *obj, void *ei)
{
__WFD_APP_FUNC_ENTER__;
- if (obj == NULL || data == NULL) {
+ if (obj == NULL || data == NULL)
return;
- }
+
Eina_Bool state = elm_check_state_get(obj);
- if (state) {
+ if (state)
elm_entry_password_set((Evas_Object *)data, EINA_FALSE);
- } else {
+ else
elm_entry_password_set((Evas_Object *)data, EINA_TRUE);
- }
+
__WFD_APP_FUNC_EXIT__;
}
__WFD_APP_FUNC_ENTER__;
Elm_Object_Item *item = NULL;
item = (Elm_Object_Item *)ei;
- if (item == NULL) {
+ if (item == NULL)
return;
- }
+
wfd_appdata_t *ad = wfd_get_appdata();
if (ad == NULL) {
WFD_APP_LOG(WFD_APP_LOG_LOW, "Incorrect parameter(NULL)\n");
elm_genlist_item_selected_set(item, EINA_FALSE);
Eina_Bool state = elm_check_state_get(ck);
elm_check_state_set(ck, !state);
- if (ad) {
+ if (ad)
_chk_changed_cb(ad->pin_entry, ck, NULL);
- }
+
__WFD_APP_FUNC_EXIT__;
}
{
__WFD_APP_FUNC_ENTER__;
- if (data == NULL || part == NULL) {
+ if (data == NULL || part == NULL)
return NULL;
- }
+
WFD_APP_LOG(WFD_APP_LOG_LOW, "Part %s", part);
if (!strcmp("elm.text", part)) {
const char *part)
{
__WFD_APP_FUNC_ENTER__;
- if (obj == NULL || part == NULL) {
+ if (obj == NULL || part == NULL)
return NULL;
- }
+
wfd_appdata_t *ad = wfd_get_appdata();
WFD_RETV_IF(ad == NULL, NULL, "Incorrect parameter(NULL)\n");
Evas_Object *check = NULL;
/* Entry genlist item */
ad->pin_desc_itc = elm_genlist_item_class_new();
- if(ad->pin_desc_itc != NULL) {
+ if (ad->pin_desc_itc != NULL) {
ad->pin_desc_itc->item_style = WFD_GENLIST_MULTILINE_TEXT_STYLE;
ad->pin_desc_itc->func.text_get = __wfd_main_desc_label_get;
ad->pin_desc_itc->func.content_get = NULL;
git = elm_genlist_item_append(genlist, ad->pin_desc_itc, ad, NULL,
ELM_GENLIST_ITEM_NONE, NULL, NULL);
- if(git != NULL)
+ if (git != NULL)
elm_genlist_item_select_mode_set(git,
ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
}
ad->pin_entry_itc = elm_genlist_item_class_new();
- if(ad->pin_entry_itc != NULL) {
+ if (ad->pin_entry_itc != NULL) {
ad->pin_entry_itc->item_style = "entry";
ad->pin_entry_itc->func.text_get = NULL;
ad->pin_entry_itc->func.content_get = __wfd_pin_entry_icon_get;
}
ad->paswd_itc = elm_genlist_item_class_new();
- if(ad->paswd_itc != NULL) {
+ if (ad->paswd_itc != NULL) {
ad->paswd_itc->item_style = WFD_GENLIST_1LINE_TEXT_ICON_STYLE;
ad->paswd_itc->func.text_get = __wfd_password_label;
ad->paswd_itc->func.content_get = __wfd_password_check;
ad->paswd_itc->func.del = NULL;
elm_genlist_item_append(genlist, ad->paswd_itc, pinpopup,
- NULL, ELM_GENLIST_ITEM_NONE, _gl_pswd_check_box_sel, (void *)ad );
+ NULL, ELM_GENLIST_ITEM_NONE, _gl_pswd_check_box_sel, (void *)ad);
}
btn1 = elm_button_add(pinpopup);
buf = g_strdup(haystack);
p = strstr(buf, niddle);
- if (p==NULL) {
+ if (p == NULL) {
free(buf);
return;
}
pop->resp_data2 = WFD_POP_RESP_APRV_CONNECT_NO;
ad->popup = wfd_draw_pop_type_display(ad->win, pop);
- break;
+ break;
case /* MT */ WFD_POP_APRV_CONNECTION_WPS_DISPLAY_REQ:
format_str = D_("IDS_WIFI_BODY_PS_IS_REQUESTING_A_WI_FI_DIRECT_CONNECTION_ALLOW_Q");
pop->resp_data2 = WFD_POP_RESP_APRV_CONNECT_NO;
ad->popup = wfd_draw_pop_type_c(ad->win, pop);
- break;
+ break;
case /* MT */ WFD_POP_APRV_CONNECTION_WPS_KEYPAD_REQ:
_replace_1PS_2PD((char *)pop->text, sizeof(pop->text),
pop->resp_data2 = WFD_POP_RESP_APRV_CONNECT_NO;
ad->popup = wfd_draw_pop_type_display(ad->win, pop);
- break;
+ break;
case /* MT */ WFD_POP_PROG_CONNECT:
snprintf(pop->text, sizeof(pop->text), "%s", D_("IDS_WIFI_BODY_CONNECTING_ING"));
pop->resp_data1 = WFD_POP_RESP_APRV_CONNECT_NO;
ad->popup = wfd_draw_pop_type_b(ad->win, pop);
- break;
+ break;
case /* MO */ WFD_POP_PROG_CONNECT_WITH_KEYPAD:
_replace_1PS_2PD((char *)text, sizeof(text),
pop->resp_data2 = WFD_POP_RESP_APRV_CONNECT_NO;
ad->popup = wfd_draw_pop_type_keypad(ad->win, pop);
- break;
+ break;
case /* MO/MT */ WFD_POP_PROG_CONNECT_WITH_PIN:
_replace_1PS_2PD((char *)text, sizeof(text),
pop->resp_data2 = WFD_POP_RESP_APRV_CONNECT_NO;
ad->popup = wfd_draw_pop_type_display(ad->win, pop);
- break;
+ break;
case WFD_POP_PROG_CONNECT_CANCEL:
snprintf(pop->text, sizeof(pop->text), "%s", D_("IDS_BR_SK_CANCEL"));
pop->timeout = WFD_POP_TIMER_120;
ad->popup = wfd_draw_pop_type_a(ad->win, pop);
- break;
+ break;
default:
break;
/* feedback play */
int ret = -1;
ret = feedback_play(FEEDBACK_PATTERN_GENERAL);
- if (ret != FEEDBACK_ERROR_NONE) {
- WFD_APP_LOG(WFD_APP_LOG_ERROR,"feedback_play error : %d\n", ret);
- }
+ if (ret != FEEDBACK_ERROR_NONE)
+ WFD_APP_LOG(WFD_APP_LOG_ERROR, "feedback_play error : %d\n", ret);
+
WFD_IF_FREE_MEM(peer_name);
__WFD_APP_FUNC_EXIT__;
return;
{
__WFD_APP_FUNC_ENTER__;
- if(result == APP_CONTROL_RESULT_FAILED) {
+ if (result == APP_CONTROL_RESULT_FAILED) {
WFD_APP_LOG(WFD_APP_LOG_ERROR, "User cancel to reconnect screen mirroring\n");
#ifdef WFD_SCREEN_MIRRORING_ENABLED
ad->screen_mirroring_state = WFD_POP_SCREEN_MIRROR_NONE;
app_control_h control = data;
- if (type == BUNDLE_TYPE_STR)
- {
+ if (type == BUNDLE_TYPE_STR) {
bundle_keyval_get_basic_val((bundle_keyval_t *) kv, &ptr, &size);
- buff = malloc(sizeof(char)* size + 1);
+ buff = malloc(sizeof(char) * size + 1);
snprintf(buff, size + 1, "%s", ((char*) ptr));
WFD_APP_LOG(WFD_APP_LOG_ERROR, "Found STR -KEY: %s, VAL: %s, SIZE: %d", key, buff, size);
free(buff);
} else if (type == BUNDLE_TYPE_BYTE) {
bundle_keyval_get_basic_val((bundle_keyval_t *) kv, &ptr, &size);
- buff = malloc(sizeof(char)* size + 1);
+ buff = malloc(sizeof(char) * size + 1);
snprintf(buff, size + 1, "%s", ((char*) ptr));
WFD_APP_LOG(WFD_APP_LOG_ERROR, "Found STR -KEY: %s, VAL: %s, SIZE: %d", key, buff, size);
char *launch_type = NULL;
bundle_get_str(data, "-t", &launch_type);
- if (!strcmp(launch_type, "reconnect_by_connecting_wifi_ap")) {
+ if (!strcmp(launch_type, "reconnect_by_connecting_wifi_ap"))
ret = app_control_send_launch_request(control, __launch_app_result_cb, NULL);
- } else {
+ else
ret = app_control_send_launch_request(control, NULL, NULL);
- }
if (ret != APP_CONTROL_ERROR_NONE) {
WFD_APP_LOG(WFD_APP_LOG_ERROR, "app_control_send_launch_request() is failed : %d", ret);
ad->noti_screen_mirroring_play = NULL;
}
- if(ad->noti_screen_mirroring_on != NULL) {
+ if (ad->noti_screen_mirroring_on != NULL) {
noti_err = notification_free(ad->noti_screen_mirroring_on);
WFD_RET_IF(noti_err != NOTIFICATION_ERROR_NONE, "Failed to notification_free. [%d]", noti_err);
}
ad->noti_screen_mirroring_on = NULL;
}
- if(ad->noti_screen_mirroring_play != NULL) {
+ if (ad->noti_screen_mirroring_play != NULL) {
noti_err = notification_free(ad->noti_screen_mirroring_play);
WFD_RET_IF(noti_err != NOTIFICATION_ERROR_NONE, "Failed to notification_free. [%d]", noti_err);
}
#ifdef WFD_SCREEN_MIRRORING_ENABLED
/* checking Screen Mirroring */
if (vconf_get_int(VCONFKEY_SCREEN_MIRRORING_STATE, &screen_mirroring_status) < 0)
- {
WFD_APP_LOG(WFD_APP_LOG_ERROR, "Failed to get vconf VCONFKEY_SCREEN_MIRRORING_STATE\n");
- }
+
WFD_APP_LOG(WFD_APP_LOG_LOW, "screen_mirroring_status: %d\n", screen_mirroring_status);
- if(screen_mirroring_status > VCONFKEY_SCREEN_MIRRORING_DEACTIVATED) {
+ if (screen_mirroring_status > VCONFKEY_SCREEN_MIRRORING_DEACTIVATED) {
res = vconf_set_int(VCONFKEY_SCREEN_MIRRORING_STATE, VCONFKEY_SCREEN_MIRRORING_DEACTIVATED);
- if (res < 0) {
+ if (res < 0)
WFD_APP_LOG(WFD_APP_LOG_ERROR, "Failed to set vconf VCONFKEY_SCREEN_MIRRORING_STATE\n");
- }
}
#endif
return;
}
- if(vconf_get_bool(VCONFKEY_SETAPPL_PWRSV_CUSTMODE_CPU, &cup_limit_mode) < 0) {
+ if (vconf_get_bool(VCONFKEY_SETAPPL_PWRSV_CUSTMODE_CPU, &cup_limit_mode) < 0) {
WFD_APP_LOG(WFD_APP_LOG_ERROR, "Failed to get vconf VCONFKEY_SETAPPL_PWRSV_CUSTMODE_CPU\n");
return;
}
- if (vconf_get_int(VCONFKEY_SETAPPL_PSMODE, &power_mode) < 0)
- {
+ if (vconf_get_int(VCONFKEY_SETAPPL_PSMODE, &power_mode) < 0) {
WFD_APP_LOG(WFD_APP_LOG_ERROR, "Failed to get vconf VCONFKEY_SETAPPL_PSMODE\n");
return;
}
return;
}
- if (vconf_get_int(VCONFKEY_SETAPPL_PSMODE, &power_mode) < 0)
- {
+ if (vconf_get_int(VCONFKEY_SETAPPL_PSMODE, &power_mode) < 0) {
WFD_APP_LOG(WFD_APP_LOG_ERROR, "Failed to get vconf VCONFKEY_SETAPPL_PSMODE\n");
return;
}
bundle_free(b);
} else if (power_mode == SETTING_PSMODE_POWERFUL ||
power_mode == SETTING_PSMODE_ADVISOR){
- if(vconf_get_bool(VCONFKEY_SETAPPL_PWRSV_CUSTMODE_CPU, &cup_limit_mode) < 0) {
+ if (vconf_get_bool(VCONFKEY_SETAPPL_PWRSV_CUSTMODE_CPU, &cup_limit_mode) < 0) {
WFD_APP_LOG(WFD_APP_LOG_ERROR, "Failed to get vconf VCONFKEY_SETAPPL_PWRSV_CUSTMODE_CPU\n");
return;
}
}
#endif
- if (vconf_get_int(VCONFKEY_WIFI_STATE, &wifi_status) < 0)
- {
+ if (vconf_get_int(VCONFKEY_WIFI_STATE, &wifi_status) < 0) {
WFD_APP_LOG(WFD_APP_LOG_ERROR, "Failed to get vconf VCONFKEY_WIFI_STATE\n");
return;
}
WFD_RET_IF(NULL == ad, "NULL parameters.\n");
if (vconf_get_int(VCONFKEY_SCREEN_MIRRORING_STATE, &screen_mirroring_status) < 0)
- {
WFD_APP_LOG(WFD_APP_LOG_ERROR, "Failed to get vconf VCONFKEY_SCREEN_MIRRORING_STATE\n");
- }
WFD_APP_LOG(WFD_APP_LOG_ERROR, "VCONFKEY_SCREEN_MIRRORING_STATE:%d\n", screen_mirroring_status);
if (strnlen(ad->mac_addr_connecting, MACSTR_LENGTH) > 0) {
res = wifi_direct_reject_connection(ad->mac_addr_connecting);
- if (res != WIFI_DIRECT_ERROR_NONE) {
+ if (res != WIFI_DIRECT_ERROR_NONE)
WFD_APP_LOG(WFD_APP_LOG_ERROR, "Failed to reject connection(%d)", res);
- }
}
memset(ad->mac_addr_connecting, 0x00, MACSTR_LENGTH);
wfd_destroy_popup();
/* remove callback for flight mode */
ret = vconf_ignore_key_changed(VCONFKEY_TELEPHONY_FLIGHT_MODE, _wfd_flight_mode_changed);
- if (ret == -1) {
+ if (ret == -1)
WFD_APP_LOG(WFD_APP_LOG_ERROR, "Failed to ignore vconf key callback for flight mode\n");
- }
#ifdef WFD_SCREEN_MIRRORING_ENABLED
/* remove callback for allshare cast */
ret = vconf_ignore_key_changed(VCONFKEY_SCREEN_MIRRORING_STATE, _wfd_allshare_cast_status_changed);
- if (ret == -1) {
+ if (ret == -1)
WFD_APP_LOG(WFD_APP_LOG_ERROR, "Failed to ignore vconf key callback for allshare cast\n");
- }
#endif
/* remove callback for wifi */
ret = vconf_ignore_key_changed(VCONFKEY_WIFI_STATE, _wfd_wifi_status_changed);
- if (ret == -1) {
+ if (ret == -1)
WFD_APP_LOG(WFD_APP_LOG_ERROR, "Failed to ignore vconf key callback for wifi\n");
- }
/* remove callback for power mode */
ret = vconf_ignore_key_changed(VCONFKEY_SETAPPL_PSMODE, _wfd_power_saving_mode_changed);
- if (ret == -1) {
+ if (ret == -1)
WFD_APP_LOG(WFD_APP_LOG_ERROR, "Failed to ignore vconf key callback for power mode\n");
- }
/* remove callback for cpu limit mode */
ret = vconf_ignore_key_changed(VCONFKEY_SETAPPL_PWRSV_CUSTMODE_CPU, _wfd_cpu_limit_mode_changed);
- if (ret == -1) {
+ if (ret == -1)
WFD_APP_LOG(WFD_APP_LOG_ERROR, "Failed to ignore vconf key callback for cpu limit mode\n");
- }
return 0;
}
if (ad->noti_screen_mirroring_on) {
noti_err = notification_free(ad->noti_screen_mirroring_on);
ad->noti_screen_mirroring_on = NULL;
- if (noti_err != NOTIFICATION_ERROR_NONE) {
+ if (noti_err != NOTIFICATION_ERROR_NONE)
WFD_APP_LOG(WFD_APP_LOG_ERROR, "Fail to notification_free.(%d)\n", noti_err);
- }
}
if (ad->noti_screen_mirroring_play) {
noti_err = notification_free(ad->noti_screen_mirroring_play);
ad->noti_screen_mirroring_play = NULL;
- if (noti_err != NOTIFICATION_ERROR_NONE) {
+ if (noti_err != NOTIFICATION_ERROR_NONE)
WFD_APP_LOG(WFD_APP_LOG_ERROR, "Fail to notification_free.(%d)\n", noti_err);
- }
}
#endif
if (ad->noti_wifi_direct_on) {
noti_err = notification_free(ad->noti_wifi_direct_on);
ad->noti_wifi_direct_on = NULL;
- if (noti_err != NOTIFICATION_ERROR_NONE) {
+ if (noti_err != NOTIFICATION_ERROR_NONE)
WFD_APP_LOG(WFD_APP_LOG_ERROR, "Fail to notification_free.(%d)\n", noti_err);
- }
}
#endif
if (ad->noti_wifi_direct_connected) {
noti_err = notification_free(ad->noti_wifi_direct_connected);
ad->noti_wifi_direct_connected = NULL;
- if (noti_err != NOTIFICATION_ERROR_NONE) {
+ if (noti_err != NOTIFICATION_ERROR_NONE)
WFD_APP_LOG(WFD_APP_LOG_ERROR, "Fail to notification_free.(%d)\n", noti_err);
- }
}
__WFD_APP_FUNC_EXIT__;
notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
WFD_RET_IF(ad->noti_wifi_direct_on, "Indicator already exists");
- if(ad->noti_wifi_direct_on != NULL) {
+ if (ad->noti_wifi_direct_on != NULL) {
noti_err = notification_free(ad->noti_wifi_direct_on);
WFD_RET_IF(noti_err != NOTIFICATION_ERROR_NONE, "Failed to notification_free. [%d]", noti_err);
}
return;
}
- if (vconf_get_int(VCONFKEY_SCREEN_MIRRORING_STATE, &screen_mirroring_status) < 0) {
+ if (vconf_get_int(VCONFKEY_SCREEN_MIRRORING_STATE, &screen_mirroring_status) < 0)
WFD_APP_LOG(WFD_APP_LOG_ERROR, "Failed to get vconf VCONFKEY_SCREEN_MIRRORING_STATE\n");
- }
WFD_APP_LOG(WFD_APP_LOG_LOW, "screen_mirroring_status: %d\n", screen_mirroring_status);
/* Set the vconf value to DEACTIVATED only when the previous vconf value is CONNECTED.
If the previous vconf value is ACTIVATED, it means that the Screen Mirroring UG changed that key already. So no need to change it. */
- if(screen_mirroring_status == VCONFKEY_SCREEN_MIRRORING_CONNECTED) {
+ if (screen_mirroring_status == VCONFKEY_SCREEN_MIRRORING_CONNECTED) {
result = vconf_set_int(VCONFKEY_SCREEN_MIRRORING_STATE, VCONFKEY_SCREEN_MIRRORING_DEACTIVATED);
- if (result < 0) {
+ if (result < 0)
WFD_APP_LOG(WFD_APP_LOG_ERROR, "Failed to set vconf VCONFKEY_SCREEN_MIRRORING_STATE\n");
- }
+
notification_status_message_post(D_("IDS_SMR_POP_SCREEN_MIRRORING_HAS_BEEN_DISABLED"));
}
/* delete all notifications */
wfd_app_util_del_notification(ad);
- if(ad->noti_wifi_direct_connected!= NULL) {
+ if (ad->noti_wifi_direct_connected != NULL) {
noti_err = notification_free(ad->noti_wifi_direct_connected);
WFD_RET_IF(noti_err != NOTIFICATION_ERROR_NONE, "Failed to notification_free. [%d]", noti_err);
}
if (ad->noti_wifi_direct_connected) {
noti_err = notification_free(ad->noti_wifi_direct_connected);
ad->noti_wifi_direct_connected = NULL;
- if (noti_err != NOTIFICATION_ERROR_NONE) {
+ if (noti_err != NOTIFICATION_ERROR_NONE)
WFD_APP_LOG(WFD_APP_LOG_ERROR, "Fail to notification_free.(%d)\n", noti_err);
- }
}
__WFD_APP_FUNC_EXIT__;
typedef enum {
MOTION_TARGET_VIEW_FOCUS_ON = 0,
MOTION_TARGET_VIEW_FOCUS_OFF
-}TARGET_VIEW_FOCUS;
+} TARGET_VIEW_FOCUS;
void motion_create(struct ug_data *);
void motion_destroy(void);
#define WFD_IF_DEL_OBJ(obj) \
do { \
- if(obj) { \
+ if (obj) { \
evas_object_del(obj); \
obj = NULL; \
} \
#define WFD_IF_DEL_ITEM(obj) \
do { \
- if(obj) { \
+ if (obj) { \
elm_object_item_del(obj); \
obj = NULL; \
} \
#define WFD_RET_IF(expr, fmt, args...) \
do { \
- if(expr) { \
- DBG(LOG_ERROR, "[%s] Return, message "fmt, #expr, ##args );\
+ if (expr) { \
+ DBG(LOG_ERROR, "[%s] Return, message "fmt, #expr, ##args);\
return; \
} \
} while (0)
#define WFD_RETV_IF(expr, val, fmt, args...) \
do { \
- if(expr) { \
- DBG(LOG_ERROR,"[%s] Return value, message "fmt, #expr, ##args );\
+ if (expr) { \
+ DBG(LOG_ERROR, "[%s] Return value, message "fmt, #expr, ##args);\
return (val); \
} \
} while (0)
#define WFD_IF_FREE_MEM(mem) \
do { \
- if(mem) { \
+ if (mem) { \
free(mem); \
mem = NULL; \
} \
} discovery_status_e;
-typedef struct device_type_s_{
+typedef struct device_type_s_ {
char ssid[SSID_LENGTH + 1];
unsigned int category;
unsigned int sub_category;
}
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__;
{
struct ug_data *ugd = (struct ug_data *)data;
- if ((ugd == NULL) || (ugd->naviframe == NULL)) {
+ if ((ugd == NULL) || (ugd->naviframe == NULL))
return MOTION_TARGET_VIEW_FOCUS_OFF;
- }
- if (elm_object_focus_get(ugd->naviframe)) {
+ if (elm_object_focus_get(ugd->naviframe))
return MOTION_TARGET_VIEW_FOCUS_ON;
- } else {
+ else
return MOTION_TARGET_VIEW_FOCUS_OFF;
- }
}
gboolean motion_activated = FALSE;
struct ug_data *ugd = (struct ug_data *) data;
if (NULL == ugd) {
- DBG(LOG_ERROR,"NULL pointer!");
+ DBG(LOG_ERROR, "NULL pointer!");
return;
}
TARGET_VIEW_FOCUS focus_state = __motion_target_view_focus_get(ugd);
DBG(LOG_DEBUG, "event type: %d, focus state: %d\n", event_type, focus_state);
- if (focus_state != MOTION_TARGET_VIEW_FOCUS_ON) {
+ if (focus_state != MOTION_TARGET_VIEW_FOCUS_ON)
return;
- }
if (vconf_get_bool(VCONFKEY_SETAPPL_MOTION_ACTIVATION,
(void *)&motion_activated)) {
- DBG(LOG_ERROR,"Get motion activation status fail");
+ DBG(LOG_ERROR, "Get motion activation status fail");
return;
}
if (FALSE == motion_activated) {
- DBG(LOG_INFO,"Motion value is false");
+ DBG(LOG_INFO, "Motion value is false");
return;
}
}
if (FALSE == motion_activated) {
- DBG(LOG_INFO,"Shake status is false");
+ DBG(LOG_INFO, "Shake status is false");
return;
}
fail:
ret = sf_disconnect(motion_handle);
- if (ret < 0) {
+ if (ret < 0)
DBG(LOG_ERROR, "Failed Operation sf_disconnect. [%d]\n", ret);
- }
}
void motion_destroy(void)
}
ret = sf_stop(motion_handle);
- if (ret < 0) {
+ if (ret < 0)
DBG(LOG_ERROR, "Failed Operation sf_stop. [%d]\n", ret);
- }
+
ret = sf_unregister_event(motion_handle, MOTION_ENGINE_EVENT_SHAKE);
- if (ret < 0) {
+ if (ret < 0)
DBG(LOG_ERROR, "Failed Operation sf_unregister_event. [%d]\n", ret);
- }
+
ret = sf_disconnect(motion_handle);
- if (ret < 0) {
+ if (ret < 0)
DBG(LOG_ERROR, "Failed Operation sf_disconnect. [%d]\n", ret);
- }
}
char *vconf_name = vconf_keynode_get_name(key);
- if (!g_strcmp0(vconf_name, VCONFKEY_SETAPPL_DEVICE_NAME_STR)){
+ if (!g_strcmp0(vconf_name, VCONFKEY_SETAPPL_DEVICE_NAME_STR)) {
char *name_value = NULL;
name_value = vconf_get_str(VCONFKEY_SETAPPL_DEVICE_NAME_STR);
- WFD_RET_IF (!name_value, "Get string is failed");
- DBG(LOG_INFO,"name : %s", name_value);
+ WFD_RET_IF(!name_value, "Get string is failed");
+ DBG(LOG_INFO, "name : %s", name_value);
if (ugd->device_name_item && g_strcmp0(ugd->dev_name, name_value))
wfd_ug_view_refresh_glitem(ugd->device_name_item);
}
if (ugd->wfd_status <= WIFI_DIRECT_STATE_DEACTIVATING) {
DBG(LOG_INFO, "Activate WiFi Direct...");
- if (FALSE != wfd_client_switch_on(ugd)) {
+ if (FALSE != wfd_client_switch_on(ugd))
DBG(LOG_ERROR, "Failed to Activate WiFi Direct");
- }
}
}
}
DBG(LOG_INFO, "__wfd_hotspot_mode_vconf_change_cb mode %d", hotspot_mode);
if (VCONFKEY_MOBILE_HOTSPOT_MODE_NONE == hotspot_mode) {
- if (NULL != ugd->act_popup) {
+ if (NULL != ugd->act_popup)
evas_object_del(ugd->act_popup);
- }
+
#ifdef WFD_ON_OFF_GENLIST
wfd_ug_refresh_on_off_check(ugd);
#endif
evas_object_event_callback_del(ugd->base, EVAS_CALLBACK_SHOW, _wfd_init_cb);
res = launch_wifi_direct_manager(ugd);
- if (res != 0) {
+ if (res != 0)
DBG(LOG_ERROR, "Failed to launch wifi direct manager\n");
- }
__FUNC_EXIT__;
return;
int wfd_status = -1;
int ret;
- if (!ug || !priv) {
+ if (!ug || !priv)
return NULL;
- }
ugd = priv;
ugd->ug = ug;
bindtextdomain(PACKAGE, LOCALEDIR);
ugd->win = ug_get_window();
- if (!ugd->win) {
+ if (!ugd->win)
return NULL;
- }
/* set rotation */
if (elm_win_wm_rotation_supported_get(ugd->win)) {
}
ret = app_control_get_extra_data(control, "viewtype", &viewtype);
- if(ret == APP_CONTROL_ERROR_NONE && viewtype) {
+ if (ret == APP_CONTROL_ERROR_NONE && viewtype) {
DBG(LOG_INFO, "viewtype: %s\n", viewtype);
ugd->view_type = strdup(viewtype);
WFD_IF_FREE_MEM(viewtype);
ret = app_control_get_extra_data(control, "device_filter", &device_filter);
if (ret == APP_CONTROL_ERROR_NONE && device_filter) {
DBG(LOG_INFO, "Device filter: %s", device_filter);
- if (0 == strncmp(device_filter, "computer", 8)) {
+ if (0 == strncmp(device_filter, "computer", 8))
ugd->device_filter = WFD_DEVICE_TYPE_COMPUTER;
- } else if (0 == strncmp(device_filter, "input_device", 12)) {
+ else if (0 == strncmp(device_filter, "input_device", 12))
ugd->device_filter = WFD_DEVICE_TYPE_INPUT_DEVICE;
- } else if (0 == strncmp(device_filter, "printer", 6)) {
+ else if (0 == strncmp(device_filter, "printer", 6))
ugd->device_filter = WFD_DEVICE_TYPE_PRINTER;
- } else if (0 == strncmp(device_filter, "camera", 6)) {
+ else if (0 == strncmp(device_filter, "camera", 6))
ugd->device_filter = WFD_DEVICE_TYPE_CAMERA;
- } else if (0 == strncmp(device_filter, "storage", 7)) {
+ else if (0 == strncmp(device_filter, "storage", 7))
ugd->device_filter = WFD_DEVICE_TYPE_STORAGE;
- } else if (0 == strncmp(device_filter, "network_infra", 13)) {
+ else if (0 == strncmp(device_filter, "network_infra", 13))
ugd->device_filter = WFD_DEVICE_TYPE_NW_INFRA;
- } else if (0 == strncmp(device_filter, "display", 7)) {
+ else if (0 == strncmp(device_filter, "display", 7))
ugd->device_filter = WFD_DEVICE_TYPE_DISPLAYS;
- } else if (0 == strncmp(device_filter, "multimedia_device", 17)) {
+ else if (0 == strncmp(device_filter, "multimedia_device", 17))
ugd->device_filter = WFD_DEVICE_TYPE_MM_DEVICES;
- } else if (0 == strncmp(device_filter, "game_device", 11)) {
+ else if (0 == strncmp(device_filter, "game_device", 11))
ugd->device_filter = WFD_DEVICE_TYPE_GAME_DEVICES;
- } else if (0 == strncmp(device_filter, "telephone", 9)) {
+ else if (0 == strncmp(device_filter, "telephone", 9))
ugd->device_filter = WFD_DEVICE_TYPE_TELEPHONE;
- } else if (0 == strncmp(device_filter, "audio", 5)) {
+ else if (0 == strncmp(device_filter, "audio", 5))
ugd->device_filter = WFD_DEVICE_TYPE_AUDIO;
- } else {
+ else
ugd->device_filter = WFD_DEVICE_TYPE_OTHER;
- }
+
WFD_IF_FREE_MEM(device_filter);
}
ret = app_control_get_extra_data(control, "auto_exit", &auto_exit);
if (ret == APP_CONTROL_ERROR_NONE && auto_exit) {
DBG(LOG_INFO, "Auto exit: %s", auto_exit);
- if (0 == strncmp(auto_exit, "on", 2)) {
+ if (0 == strncmp(auto_exit, "on", 2))
ugd->is_auto_exit = true;
- } else {
+ else
ugd->is_auto_exit = false;
- }
+
WFD_IF_FREE_MEM(auto_exit);
}
ret = app_control_get_extra_data(control, "multi_connect", &multi_connect);
if (ret == APP_CONTROL_ERROR_NONE && multi_connect) {
DBG(LOG_INFO, "Multi connection: %s", multi_connect);
- if (0 == strncmp(multi_connect, "off", 2)) {
+ if (0 == strncmp(multi_connect, "off", 2))
ugd->is_multi_connect = false;
- } else {
+ else
ugd->is_multi_connect = true;
- }
+
WFD_IF_FREE_MEM(multi_connect);
}
}
}
- if (mode == UG_MODE_FULLVIEW) {
+ if (mode == UG_MODE_FULLVIEW)
ugd->base = _create_fullview(ugd->win, ugd);
- } else {
+ else
ugd->base = _create_frameview(ugd->win, ugd);
- }
if (ugd->base) {
evas_object_event_callback_add(ugd->base, EVAS_CALLBACK_DEL, wfd_ug_layout_del_cb, ugd);
/* check status of wifi-direct from vconf */
wfd_status = wfd_get_vconf_status();
- if (wfd_status < 0) {
+ if (wfd_status < 0)
return NULL;
- }
/* draw UI */
initialize_gen_item_class();
}
ret = vconf_notify_key_changed(VCONFKEY_SETAPPL_DEVICE_NAME_STR,
__wfd_main_vconf_change_cb, ugd);
- if (ret) {
+ if (ret)
DBG(LOG_ERROR, "Failed to set vconf notification callback(VCONFKEY_SETAPPL_DEVICE_NAME_STR)");
- }
#ifdef WIFI_STATE_CB
ret = vconf_notify_key_changed(VCONFKEY_WIFI_STATE, _wifi_on_state_cb, ugd);
- if (ret) {
+ if (ret)
DBG(LOG_ERROR, "Failed to set vconf notification callback(VCONFKEY_WIFI_STATE)");
-
- }
#endif
ret = vconf_notify_key_changed(VCONFKEY_MOBILE_HOTSPOT_MODE,
__wfd_hotspot_mode_vconf_change_cb, ugd);
- if (ret) {
+ if (ret)
DBG(LOG_ERROR, "Failed to set vconf notification callback(MOBILE_HOTSPOT_MODE)");
- }
__FUNC_EXIT__;
return ugd->base;
struct ug_data *ugd;
int res;
- if (!ug || !priv) {
+ if (!ug || !priv)
return;
- }
ugd = priv;
wfd_refresh_wifi_direct_state(ugd);
DBG(LOG_INFO, "on pause, wfd status: %d\n", ugd->wfd_status);
- if ((WIFI_DIRECT_STATE_DISCOVERING == ugd->wfd_status) &&
+ if ((WIFI_DIRECT_STATE_DISCOVERING == ugd->wfd_status) &&
(WIFI_DIRECT_ERROR_NONE != wifi_direct_cancel_discovery())) {
DBG(LOG_ERROR, "Failed to send cancel discovery state [%d]\n", ugd->wfd_status);
__FUNC_EXIT__;
/* DeInit WiFi Direct */
ret = deinit_wfd_client(ugd);
- if (ret) {
- DBG(LOG_ERROR,"Failed to DeInit WiFi Direct");
- }
+ if (ret)
+ DBG(LOG_ERROR, "Failed to DeInit WiFi Direct");
if (ugd->scan_toolbar) {
wfd_ug_view_refresh_button(ugd->scan_toolbar,
ret = vconf_ignore_key_changed(VCONFKEY_SETAPPL_DEVICE_NAME_STR,
__wfd_main_vconf_change_cb);
- if (ret == -1) {
- DBG(LOG_ERROR,"Failed to ignore vconf key callback\n");
- }
+ if (ret == -1)
+ DBG(LOG_ERROR, "Failed to ignore vconf key callback\n");
#ifdef WIFI_STATE_CB
ret = vconf_ignore_key_changed(VCONFKEY_WIFI_STATE, _wifi_on_state_cb);
- if (ret == -1) {
- DBG(LOG_ERROR,"Failed to ignore vconf key callback\n");
- }
+ if (ret == -1)
+ DBG(LOG_ERROR, "Failed to ignore vconf key callback\n");
#endif
ret = vconf_ignore_key_changed(VCONFKEY_MOBILE_HOTSPOT_MODE,
__wfd_hotspot_mode_vconf_change_cb);
- if (ret == -1) {
- DBG(LOG_ERROR,"Failed to ignore vconf key callback MOBILE_HOTSPOT_MODE\n");
- }
+ if (ret == -1)
+ DBG(LOG_ERROR, "Failed to ignore vconf key callback MOBILE_HOTSPOT_MODE\n");
wfd_ug_view_free_peers(ugd);
WFD_IF_FREE_MEM(ugd->title);
DBG(LOG_DEBUG, "Msg from app: %s", app_msg);
if (!strcmp(app_msg, "destroy")) {
- if(!ugd->rename_popup) {
+ if (!ugd->rename_popup) {
DBG(LOG_INFO, "Destroying UG.");
wfd_ug_view_free_peers(ugd);
wfd_destroy_ug(ugd);
DBG(LOG_INFO, "%s", ugd->dev_name);
if (ugd->dev_name) {
dev_name = elm_entry_utf8_to_markup(ugd->dev_name);
- if (NULL == dev_name) {
+ if (NULL == dev_name)
DBG(LOG_ERROR, "elm_entry_utf8_to_markup failed.\n");
- }
}
}
return dev_name;
}
-static Evas_Object *_gl_wfd_onoff_content_get(void *data,Evas_Object *obj,
+static Evas_Object *_gl_wfd_onoff_content_get(void *data, Evas_Object *obj,
const char *part)
{
__FUNC_ENTER__;
elm_layout_theme_set(icon, "layout", "list/C/type.3", "default");
/* Wi-Fi on indication button */
- btn= elm_check_add(icon);
+ btn = elm_check_add(icon);
elm_object_style_set(btn, "on&off");
elm_check_state_set(btn, ugd->wfd_onoff);
evas_object_propagate_events_set(btn, EINA_FALSE);
- evas_object_smart_callback_add(btn, "changed",_onoff_changed_cb, ugd);
+ evas_object_smart_callback_add(btn, "changed", _onoff_changed_cb, ugd);
ugd->on_off_check = btn;
evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND,
WFD_RETV_IF(data == NULL, NULL, "Incorrect parameter(NULL)\n");
DBG(LOG_INFO, "%s", part);
- if (!strcmp("elm.text", part)) {
+ if (!strcmp("elm.text", part))
return g_strdup(D_("IDS_WIFI_HEADER_AVAILABLE_DEVICES_ABB"));
- }
+
__FUNC_EXIT__;
return NULL;
}
WFD_RETV_IF(data == NULL, NULL, "Incorrect parameter(NULL)\n");
DBG(LOG_INFO, "%s", part);
- if (!strcmp("elm.text", part)) {
+ if (!strcmp("elm.text", part))
return g_strdup(D_("IDS_WIFI_HEADER_AVAILABLE_DEVICES_ABB"));
- }
__FUNC_EXIT__;
return NULL;
__FUNC_ENTER__;
WFD_RETV_IF(data == NULL, NULL, "Incorrect parameter(NULL)\n");
- if (!strcmp("elm.text", part)) {
+ if (!strcmp("elm.text", part))
return g_strdup(D_("IDS_WIFI_HEADER_AVAILABLE_DEVICES_ABB"));
- }
__FUNC_EXIT__;
return NULL;
return NULL;
}
DBG(LOG_INFO, "available- %s", part);
- if (!strcmp("elm.text", part)) {
+ if (!strcmp("elm.text", part))
return g_strdup(D_("IDS_WIFI_HEADER_AVAILABLE_DEVICES_ABB"));
- }
__FUNC_EXIT__;
return NULL;
g_strlcpy(buf, D_("IDS_WIFI_BODY_CONNECTING_ING"), WFD_GLOBALIZATION_STR_LENGTH);
break;
case PEER_CONN_STATUS_CONNECTED:
- if (peer->is_group_owner == FALSE) {
+ if (peer->is_group_owner == FALSE)
g_strlcpy(buf, D_("IDS_COM_BODY_CONNECTED_M_STATUS"), WFD_GLOBALIZATION_STR_LENGTH);
- } else {
+ else
g_strlcpy(buf, D_("IDS_CHATON_BODY_AVAILABLE"), WFD_GLOBALIZATION_STR_LENGTH);
- }
break;
case PEER_CONN_STATUS_FAILED_TO_CONNECT:
g_strlcpy(buf, D_("IDS_CHATON_HEADER_CONNECTION_FAILED_ABB2"), WFD_GLOBALIZATION_STR_LENGTH);
img_name = WFD_ICON_DEVICE_DISPLAY;
break;
case WFD_DEVICE_TYPE_MM_DEVICES:
- if (peer->sub_category == WIFI_DIRECT_SECONDARY_DEVICE_TYPE_MULTIMEDIA_STB) {
+ if (peer->sub_category == WIFI_DIRECT_SECONDARY_DEVICE_TYPE_MULTIMEDIA_STB)
img_name = WFD_ICON_DEVICE_STB;
- } else if (peer->sub_category == WIFI_DIRECT_SECONDARY_DEVICE_TYPE_MULTIMEDIA_MS_MA_ME) {
+ else if (peer->sub_category == WIFI_DIRECT_SECONDARY_DEVICE_TYPE_MULTIMEDIA_MS_MA_ME)
img_name = WFD_ICON_DEVICE_DONGLE;
- } else if (peer->sub_category == WIFI_DIRECT_SECONDARY_DEVICE_TYPE_MULTIMEDIA_PVP) {
+ else if (peer->sub_category == WIFI_DIRECT_SECONDARY_DEVICE_TYPE_MULTIMEDIA_PVP)
img_name = WFD_ICON_DEVICE_BD;
- } else {
+ else
img_name = WFD_ICON_DEVICE_MULTIMEDIA;
- }
break;
case WFD_DEVICE_TYPE_GAME_DEVICES:
img_name = WFD_ICON_DEVICE_GAMING;
img_name = WFD_ICON_DEVICE_TELEPHONE;
break;
case WFD_DEVICE_TYPE_AUDIO:
- if (peer->sub_category == WIFI_DIRECT_SECONDARY_DEVICE_TYPE_AUDIO_TUNER) {
+ if (peer->sub_category == WIFI_DIRECT_SECONDARY_DEVICE_TYPE_AUDIO_TUNER)
img_name = WFD_ICON_DEVICE_HOME_THEATER;
- } else {
+ else
img_name = WFD_ICON_DEVICE_HEADSET;
- }
break;
default:
img_name = WFD_ICON_DEVICE_UNKNOWN;
img_name = WFD_ICON_DEVICE_DISPLAY;
break;
case WFD_DEVICE_TYPE_MM_DEVICES:
- if (peer->sub_category == WIFI_DIRECT_SECONDARY_DEVICE_TYPE_MULTIMEDIA_STB) {
+ if (peer->sub_category == WIFI_DIRECT_SECONDARY_DEVICE_TYPE_MULTIMEDIA_STB)
img_name = WFD_ICON_DEVICE_STB;
- } else if (peer->sub_category == WIFI_DIRECT_SECONDARY_DEVICE_TYPE_MULTIMEDIA_MS_MA_ME) {
+ else if (peer->sub_category == WIFI_DIRECT_SECONDARY_DEVICE_TYPE_MULTIMEDIA_MS_MA_ME)
img_name = WFD_ICON_DEVICE_DONGLE;
- } else if (peer->sub_category == WIFI_DIRECT_SECONDARY_DEVICE_TYPE_MULTIMEDIA_PVP) {
+ else if (peer->sub_category == WIFI_DIRECT_SECONDARY_DEVICE_TYPE_MULTIMEDIA_PVP)
img_name = WFD_ICON_DEVICE_BD;
- } else {
+ else
img_name = WFD_ICON_DEVICE_MULTIMEDIA;
- }
break;
case WFD_DEVICE_TYPE_GAME_DEVICES:
img_name = WFD_ICON_DEVICE_GAMING;
img_name = WFD_ICON_DEVICE_TELEPHONE;
break;
case WFD_DEVICE_TYPE_AUDIO:
- if (peer->sub_category == WIFI_DIRECT_SECONDARY_DEVICE_TYPE_AUDIO_TUNER) {
+ if (peer->sub_category == WIFI_DIRECT_SECONDARY_DEVICE_TYPE_AUDIO_TUNER)
img_name = WFD_ICON_DEVICE_HOME_THEATER;
- } else {
+ else
img_name = WFD_ICON_DEVICE_HEADSET;
- }
break;
default:
img_name = WFD_ICON_DEVICE_UNKNOWN;
return NULL;
}
- DBG(LOG_INFO,"part = %s",part);
- if (!strcmp("elm.text", part)) {
+ DBG(LOG_INFO, "part = %s", part);
+ if (!strcmp("elm.text", part))
return g_strdup(D_("IDS_BT_BODY_NO_DEVICES_FOUND_ABB"));
- }
+
__FUNC_EXIT__;
return NULL;
}
DBG(LOG_ERROR, "Incorrect parameter(NULL)\n");
return NULL;
}
- DBG(LOG_INFO,"part = %s",part);
- if (!strcmp("elm.text", part)) {
+ DBG(LOG_INFO, "part = %s", part);
+ if (!strcmp("elm.text", part))
return g_strdup(D_("IDS_ST_HEADER_CONNECTED_DEVICES"));
- }
__FUNC_EXIT__;
return NULL;
int hexcolor = 0;
char *string = NULL;
string = g_try_malloc0(MAX_HEX_COLOR_LENGTH);
- if (string == NULL) {
+ if (string == NULL)
return string;
- }
+
hexcolor = (r << 24) + (g << 16) + (b << 8) + a;
- snprintf(string, MAX_HEX_COLOR_LENGTH, "%08x", hexcolor );
+ snprintf(string, MAX_HEX_COLOR_LENGTH, "%08x", hexcolor);
return string;
}
return NULL;
}
- if (!strcmp("elm.text", part)) {
+ if (!strcmp("elm.text", part))
return g_strdup(D_("IDS_WIFI_SBODY_NOT_CONNECTED_M_STATUS_ABB"));
- }
__FUNC_EXIT__;
return NULL;
DBG(LOG_INFO, "%s", part);
if (!strcmp("elm.text", part) && ugd) {
- if (ugd->multi_connect_mode == WFD_MULTI_CONNECT_MODE_IN_PROGRESS) {
+ if (ugd->multi_connect_mode == WFD_MULTI_CONNECT_MODE_IN_PROGRESS)
return g_strdup(D_("IDS_WIFI_HEADER_AVAILABLE_DEVICES_ABB"));
- } else if (ugd->multi_connect_mode == WFD_MULTI_CONNECT_MODE_COMPLETED) {
+ else if (ugd->multi_connect_mode == WFD_MULTI_CONNECT_MODE_COMPLETED)
return g_strdup(D_("IDS_WIFI_SBODY_NOT_CONNECTED_M_STATUS_ABB"));
- }
}
__FUNC_EXIT__;
DBG(LOG_INFO, "Part %s", part);
check = elm_check_add(icon_layout);
ugd->select_all_icon = check;
- if (ugd->is_select_all_checked == EINA_TRUE) {
+ if (ugd->is_select_all_checked == EINA_TRUE)
elm_check_state_set(ugd->select_all_icon, TRUE);
- }
+
elm_object_style_set(check, "default/genlist");
evas_object_propagate_events_set(check, EINA_FALSE);
evas_object_smart_callback_add(check, "changed",
}
DBG(LOG_INFO, "%s", part);
- if (!strcmp("elm.text", part)) {
+ if (!strcmp("elm.text", part))
return g_strdup(D_("IDS_ST_HEADER_BUSY_DEVICES"));
- }
__FUNC_EXIT__;
return NULL;
wfd_ug_view_refresh_button(btn, "IDS_WIFI_SK4_SCAN",
FALSE);
}
- evas_object_smart_callback_add(btn, "clicked",_scan_btn_cb, (void *)ugd);
+ evas_object_smart_callback_add(btn, "clicked", _scan_btn_cb, (void *)ugd);
elm_layout_content_set(ugd->button_layout, "button.big", btn);
ugd->scan_toolbar = btn;
if (ugd->is_conn_incoming) {
DBG(LOG_INFO, "Reject the incoming connection before client deregister \n");
ret = wifi_direct_reject_connection(ugd->mac_addr_connecting);
- if (ret != WIFI_DIRECT_ERROR_NONE) {
+ if (ret != WIFI_DIRECT_ERROR_NONE)
DBG(LOG_ERROR, "Failed to send reject request [%d]\n", ret);
- }
} else {
DBG(LOG_INFO, "Cancel the outgoing connection before client deregister \n");
ret = wifi_direct_cancel_connection(ugd->mac_addr_connecting);
- if (ret != WIFI_DIRECT_ERROR_NONE) {
+ if (ret != WIFI_DIRECT_ERROR_NONE)
DBG(LOG_ERROR, "Failed to send cancel request [%d]\n", ret);
- }
}
ugd->mac_addr_connecting = NULL;
}
if (ugd->raw_connected_peer_cnt == 0) {
ret = wifi_direct_is_group_owner(&owner);
if (ret == WIFI_DIRECT_ERROR_NONE) {
- if (owner) {
+ if (owner)
wifi_direct_destroy_group();
- }
}
}
if (ret) {
DBG(LOG_ERROR, "Failed to create control");
} else {
- if (ugd->wfd_status > WIFI_DIRECT_STATE_CONNECTING) {
+ if (ugd->wfd_status > WIFI_DIRECT_STATE_CONNECTING)
app_control_add_extra_data(control, "Connection", "TRUE");
- } else {
+ else
app_control_add_extra_data(control, "Connection", "FALSE");
- }
ug_send_result(ugd->ug, control);
app_control_destroy(control);
bool owner = FALSE;
app_control_h control = NULL;
- if(ugd == NULL) {
+ if (ugd == NULL) {
DBG(LOG_ERROR, "The param is NULL");
return;
}
if (ugd->is_conn_incoming) {
DBG(LOG_INFO, "Reject the incoming connection before client deregister \n");
ret = wifi_direct_reject_connection(ugd->mac_addr_connecting);
- if (ret != WIFI_DIRECT_ERROR_NONE) {
+ if (ret != WIFI_DIRECT_ERROR_NONE)
DBG(LOG_ERROR, "Failed to send reject request [%d]\n", ret);
- }
} else {
DBG(LOG_INFO, "Cancel the outgoing connection before client deregister \n");
ret = wifi_direct_cancel_connection(ugd->mac_addr_connecting);
- if (ret != WIFI_DIRECT_ERROR_NONE) {
+ if (ret != WIFI_DIRECT_ERROR_NONE)
DBG(LOG_ERROR, "Failed to send cancel request [%d]\n", ret);
- }
}
ugd->mac_addr_connecting = NULL;
}
if (ugd->raw_connected_peer_cnt == 0) {
ret = wifi_direct_is_group_owner(&owner);
if (ret == WIFI_DIRECT_ERROR_NONE) {
- if (owner) {
+ if (owner)
wifi_direct_destroy_group();
- }
}
}
if (ret) {
DBG(LOG_ERROR, "Failed to create control");
} else {
- if (ugd->wfd_status > WIFI_DIRECT_STATE_CONNECTING) {
+ if (ugd->wfd_status > WIFI_DIRECT_STATE_CONNECTING)
app_control_add_extra_data(control, "Connection", "TRUE");
- } else {
+ else
app_control_add_extra_data(control, "Connection", "FALSE");
- }
ug_send_result(ugd->ug, control);
app_control_destroy(control);
{
__FUNC_ENTER__;
- if(ugd->timer_stop_progress_bar > 0) {
+ if (ugd->timer_stop_progress_bar > 0)
g_source_remove(ugd->timer_stop_progress_bar);
- }
+
ugd->timer_stop_progress_bar = 0;
__FUNC_EXIT__;
{
__FUNC_ENTER__;
- if(ugd->timer_delete_not_alive_peer > 0) {
+ if (ugd->timer_delete_not_alive_peer > 0)
g_source_remove(ugd->timer_delete_not_alive_peer);
- }
+
ugd->timer_delete_not_alive_peer = 0;
__FUNC_EXIT__;
int ret = -1;
const char *btn_text = NULL;
btn_text = elm_object_part_text_get(ugd->scan_toolbar, "default");
- DBG(LOG_INFO, "Button text=%s",btn_text);
+ DBG(LOG_INFO, "Button text=%s", btn_text);
if (!g_strcmp0(elm_object_text_get(obj), D_("IDS_WIFI_SK4_SCAN"))) {
wfd_refresh_wifi_direct_state(ugd);
void wfd_check_gl_busy_peers(struct ug_data *ugd)
{
__FUNC_ENTER__;
- if (ugd->gl_busy_peer_cnt == 0) {
+ if (ugd->gl_busy_peer_cnt == 0)
WFD_IF_DEL_ITEM(ugd->busy_wfd_item);
- }
+
__FUNC_EXIT__;
}
void wfd_check_gl_available_peers(struct ug_data *ugd)
{
__FUNC_ENTER__;
- if (ugd->gl_available_peer_cnt == 0 && ugd->avlbl_wfd_item != NULL) {
+ if (ugd->gl_available_peer_cnt == 0 && ugd->avlbl_wfd_item != NULL)
WFD_IF_DEL_ITEM(ugd->avlbl_wfd_item);
- }
+
__FUNC_EXIT__;
}
}
while (peer) {
- if(strcmp(peer->mac_addr, mac_addr)) {
+ if (strcmp(peer->mac_addr, mac_addr)) {
peer_tmp = peer;
peer = peer->next;
} else {
- if(peer->next != NULL) {
+ if (peer->next != NULL) {
peer_tmp->next = peer->next;
break;
} else {
}
wfd_ug_get_connected_peers(ugd);
- DBG(LOG_INFO, "No of connected peers= %d",ugd->raw_connected_peer_cnt);
+ DBG(LOG_INFO, "No of connected peers= %d", ugd->raw_connected_peer_cnt);
if (ugd->raw_connected_peer_cnt >= MAX_CONNECTED_PEER_NUM) {
format_str = D_("IDS_ST_POP_YOU_CAN_CONNECT_UP_TO_PD_DEVICES_AT_THE_SAME_TIME");
snprintf(popup_text, MAX_POPUP_TEXT_SIZE, format_str, MAX_CONNECTED_PEER_NUM);
wfd_ug_warn_popup(ugd, popup_text, POP_TYPE_MULTI_CONNECT_POPUP);
- if (item) {
+ if (item)
elm_genlist_item_selected_set(item, EINA_FALSE);
- }
+
return;
}
elm_layout_content_set(ugd->button_layout, "button.big", ugd->scan_toolbar);
}
- if (item) {
+ if (item)
elm_genlist_item_selected_set(item, EINA_FALSE);
- }
GList *iterator = NULL;
/* peer exists only in genlist, waiting to be deleted */
device_type_s *peer_start = ugd->gl_avlb_peers_start;
for (iterator = ugd->raw_discovered_peer_list; iterator; iterator = iterator->next) {
- if(!strncmp(peer_start->mac_addr, peer->mac_addr, MAC_LENGTH)) {
+ if (!strncmp(peer_start->mac_addr, peer->mac_addr, MAC_LENGTH)) {
DBG(LOG_INFO, "Device [%s] found in genlist, but it is already lost", ((device_type_s *)iterator->data)->ssid);
snprintf(txt, sizeof(txt), "Cannot find device %s", ((device_type_s *)iterator->data)->ssid);
free_gl_peer(&ugd->gl_avlb_peers_start, ((device_type_s *)iterator->data)->mac_addr, &ugd->gl_available_peer_cnt);
struct ug_data *ugd = (struct ug_data *)wfd_get_ug_data();
Elm_Object_Item *item = (Elm_Object_Item *)event_info;
- if (item) {
+ if (item)
elm_genlist_item_selected_set(item, EINA_FALSE);
- }
if (NULL == ugd) {
DBG(LOG_ERROR, "Data is NULL\n");
changed_ang = elm_win_rotation_get(ugd->win);
switch (changed_ang) {
- case 0:
- case 180:
- move_x = win_w/2;
- move_y = win_h;
- break;
+ case 0:
+ case 180:
+ move_x = win_w/2;
+ move_y = win_h;
+ break;
- case 90:
- move_x = win_h/2;
- move_y = win_w;
- break;
+ case 90:
+ move_x = win_h/2;
+ move_y = win_w;
+ break;
- case 270:
- move_x = win_h/2;
- move_y = win_w;
- break;
+ case 270:
+ move_x = win_h/2;
+ move_y = win_w;
+ break;
- default:
- move_x = 0;
- move_y = 0;
- break;
+ default:
+ move_x = 0;
+ move_y = 0;
+ break;
}
evas_object_move(ugd->ctxpopup, move_x, move_y);
ugd->more_btn_multiconnect_item = NULL;
- if (ugd->ctxpopup) {
+ if (ugd->ctxpopup)
evas_object_del(ugd->ctxpopup);
- }
ugd->ctxpopup = elm_ctxpopup_add(naviframe);
elm_object_style_set(ugd->ctxpopup, "more/default");
{
__FUNC_ENTER__;
int i = 0;
- if (count < 1 || pre_item == NULL) {
+ if (count < 1 || pre_item == NULL)
return;
- }
Elm_Object_Item *item = elm_genlist_item_next_get(pre_item);
- if (item == NULL) {
+ if (item == NULL)
return;
- }
if (count == 1) {
elm_object_item_signal_emit(item, "elm,state,normal", "");
}
for (i = 0; i < count; i++) {
- if (i == 0) {
+ if (i == 0)
elm_object_item_signal_emit(item, "elm,state,top", "");
- } else if (i == count - 1) {
+ else if (i == count - 1)
elm_object_item_signal_emit(item, "elm,state,bottom", "");
- } else {
+ else
elm_object_item_signal_emit(item, "elm,state,center", "");
- }
item = elm_genlist_item_next_get(item);
}
Evas_Object *check = elm_object_item_part_content_get(item, "elm.icon");
if (check) {
Eina_Bool state = elm_check_state_get(check);
- if (state) {
+ if (state)
sr_msg = strdup(SR_CHECKBOX_ON_MSG);
- } else {
+ else
sr_msg = strdup(SR_CHECKBOX_OFF_MSG);
- }
if (sr_msg) {
Evas_Object *ao = NULL;
void wfd_ug_view_refresh_glitem(Elm_Object_Item *gl_item)
{
__FUNC_ENTER__;
- if (gl_item != NULL) {
+ if (gl_item != NULL)
elm_genlist_item_update(gl_item);
- }
+
__FUNC_EXIT__;
}
__FUNC_ENTER__;
if (ugd->I_am_group_owner == TRUE) {
- if (dev->is_connected || dev->is_group_owner) {
+ if (dev->is_connected || dev->is_group_owner)
return TRUE;
- } else {
+ else
return FALSE;
- }
} else {
- if (dev->is_connected == TRUE && dev->is_group_owner == TRUE) {
+ if (dev->is_connected == TRUE && dev->is_group_owner == TRUE)
return FALSE;
- }
- if (dev->is_connected == TRUE && dev->is_group_owner == FALSE) {
+ if (dev->is_connected == TRUE && dev->is_group_owner == FALSE)
return TRUE;
- }
- if (dev->is_connected == FALSE) {
+ if (dev->is_connected == FALSE)
return FALSE;
- }
}
__FUNC_EXIT__;
for (iterator = ugd->raw_discovered_peer_list; iterator; iterator = iterator->next) {
/* Not include the device which is connected with me */
- if (__wfd_is_device_connected_with_me(ugd, (device_type_s *)iterator->data)) {
+ if (__wfd_is_device_connected_with_me(ugd, (device_type_s *)iterator->data))
continue;
- }
+
if (!__wfd_is_device_busy(ugd, (device_type_s *)iterator->data) &&
- ((device_type_s *)iterator->data)->conn_status != PEER_CONN_STATUS_FAILED_TO_CONNECT) {
+ ((device_type_s *)iterator->data)->conn_status != PEER_CONN_STATUS_FAILED_TO_CONNECT)
(*no_of_available_dev)++;
- }
}
__FUNC_EXIT__;
for (iterator = ugd->raw_discovered_peer_list; iterator; iterator = iterator->next) {
/* Not include the device which is connected with me */
- if (__wfd_is_device_connected_with_me(ugd, (device_type_s *)iterator->data)) {
+ if (__wfd_is_device_connected_with_me(ugd, (device_type_s *)iterator->data))
continue;
- }
- if (__wfd_is_device_busy(ugd, (device_type_s *)iterator->data)) {
+
+ if (__wfd_is_device_busy(ugd, (device_type_s *)iterator->data))
(*no_of_busy_dev)++;
- }
}
__FUNC_EXIT__;
for (iterator = ugd->raw_discovered_peer_list; iterator; iterator = iterator->next) {
/* Not include the device which is connected with me */
- if (__wfd_is_device_connected_with_me(ugd, (device_type_s *)iterator->data)) {
+ if (__wfd_is_device_connected_with_me(ugd, (device_type_s *)iterator->data))
continue;
- }
+
if (!__wfd_is_device_busy(ugd, (device_type_s *)iterator->data) &&
((device_type_s *)iterator->data)->conn_status == PEER_CONN_STATUS_FAILED_TO_CONNECT) {
(*no_of_connect_failed_dev)++;
/* Wifi ON/OFF toggle button */
#ifdef WFD_ON_OFF_GENLIST
ugd->item_wifi_onoff = elm_genlist_item_append(genlist, &wfd_onoff_itc, ugd,
- NULL, ELM_GENLIST_ITEM_NONE,_onoff_changed_cb, ugd);
+ NULL, ELM_GENLIST_ITEM_NONE, _onoff_changed_cb, ugd);
elm_genlist_item_selected_set(ugd->item_wifi_onoff,
EINA_FALSE);
#endif
evas_object_smart_callback_add(genlist, "unrealized", _gl_unrealized, ugd);
ugd->device_name_item = elm_genlist_item_append(genlist, &device_name_itc, ugd, NULL,
ELM_GENLIST_ITEM_NONE, NULL, NULL);
- if(ugd->device_name_item != NULL)
+ if (ugd->device_name_item != NULL)
elm_genlist_item_select_mode_set(ugd->device_name_item, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
__FUNC_EXIT__;
if (ugd->conn_wfd_item != NULL) {
last_item = ugd->conn_wfd_item;
- for (i = 0; i < ugd->gl_connected_peer_cnt; i++) {
+ for (i = 0; i < ugd->gl_connected_peer_cnt; i++)
last_item = elm_genlist_item_next_get(last_item);
- }
+
} else {
last_item = ugd->device_name_item;
}
ugd->nodevice_title_item = elm_genlist_item_insert_after(ugd->genlist,
&title_no_device_itc, (void *)ugd, NULL, last_item,
ELM_GENLIST_ITEM_NONE, NULL, NULL);
- if(ugd->nodevice_title_item != NULL)
+ if (ugd->nodevice_title_item != NULL)
elm_genlist_item_select_mode_set(ugd->nodevice_title_item, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
ugd->nodevice_item = elm_genlist_item_insert_after(ugd->genlist, &noitem_itc, (void *)ugd, NULL,
ugd->nodevice_title_item, ELM_GENLIST_ITEM_NONE, NULL, NULL);
- if(ugd->nodevice_item != NULL)
+ if (ugd->nodevice_item != NULL)
elm_genlist_item_select_mode_set(ugd->nodevice_item, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
__FUNC_EXIT__;
ugd->busy_wfd_item = elm_genlist_item_append(ugd->genlist, &title_busy_itc, (void *)ugd,
NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
- if(ugd->busy_wfd_item != NULL)
+ if (ugd->busy_wfd_item != NULL)
elm_genlist_item_select_mode_set(ugd->busy_wfd_item, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
__FUNC_EXIT__;
return 0;
if (ugd->conn_wfd_item != NULL) {
last_item = ugd->conn_wfd_item;
- for (i=0; i<ugd->gl_connected_peer_cnt; i++) {
+ for (i = 0; i < ugd->gl_connected_peer_cnt; i++)
last_item = elm_genlist_item_next_get(last_item);
- }
+
} else {
last_item = ugd->device_name_item;
}
ugd->avlbl_wfd_item = elm_genlist_item_insert_after(ugd->genlist, &title_available_itc, (void *)ugd, NULL,
last_item, ELM_GENLIST_ITEM_NONE, NULL, NULL);
- if(ugd->avlbl_wfd_item != NULL) {
+ if (ugd->avlbl_wfd_item != NULL) {
elm_genlist_item_select_mode_set(ugd->avlbl_wfd_item, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
elm_genlist_item_update(ugd->avlbl_wfd_item);
}
ugd->multi_connect_wfd_item = elm_genlist_item_insert_after(ugd->genlist, &title_multi_connect_itc, (void *)ugd,
NULL, ugd->device_name_item, ELM_GENLIST_ITEM_NONE, NULL, NULL);
- if(ugd->multi_connect_wfd_item != NULL)
+ if (ugd->multi_connect_wfd_item != NULL)
elm_genlist_item_select_mode_set(ugd->multi_connect_wfd_item, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
__FUNC_EXIT__;
return 0;
ugd->conn_wfd_item = elm_genlist_item_insert_after(ugd->genlist, &title_conn_itc, (void *)ugd, NULL,
ugd->device_name_item, ELM_GENLIST_ITEM_NONE, NULL, NULL);
- if(ugd->conn_wfd_item != NULL) {
+ if (ugd->conn_wfd_item != NULL) {
elm_genlist_item_select_mode_set(ugd->conn_wfd_item, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
elm_genlist_item_update(ugd->conn_wfd_item);
}
if (ugd->avlbl_wfd_item != NULL) {
last_item = ugd->avlbl_wfd_item;
- for (i=0; i<ugd->gl_available_peer_cnt; i++) {
+ for (i = 0; i < ugd->gl_available_peer_cnt; i++)
last_item = elm_genlist_item_next_get(last_item);
- }
+
} else if (ugd->conn_wfd_item != NULL) {
last_item = ugd->conn_wfd_item;
- for (i=0; i<ugd->gl_connected_peer_cnt; i++) {
+ for (i = 0; i < ugd->gl_connected_peer_cnt; i++)
last_item = elm_genlist_item_next_get(last_item);
- }
+
} else {
last_item = ugd->device_name_item;
}
ugd->conn_failed_wfd_item = elm_genlist_item_insert_after(ugd->genlist, &title_conn_failed_itc, (void *)ugd,
NULL, last_item, ELM_GENLIST_ITEM_NONE, NULL, NULL);
- if(ugd->conn_failed_wfd_item != NULL)
+ if (ugd->conn_failed_wfd_item != NULL)
elm_genlist_item_select_mode_set(ugd->conn_failed_wfd_item, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
__FUNC_EXIT__;
return 0;
return ECORE_CALLBACK_CANCEL;
}
- if (ugd->avlbl_wfd_item == NULL) {
+ if (ugd->avlbl_wfd_item == NULL)
_create_available_dev_genlist(ugd);
- }
if (ugd->wfd_discovery_status == WIFI_DIRECT_DISCOVERY_BACKGROUND) {
DBG(LOG_INFO, "Background mode\n");
/* check the timeout, if not timeout, keep the cb */
interval = time(NULL) - ugd->last_display_time;
- if (interval < MAX_DISPLAY_TIME_OUT) {
+ if (interval < MAX_DISPLAY_TIME_OUT)
return ECORE_CALLBACK_RENEW;
- }
if (ugd->is_paused == false) {
DBG(LOG_INFO, "Not Paused");
void wfd_check_gl_conn_peers(struct ug_data *ugd)
{
__FUNC_ENTER__;
- if (ugd->gl_connected_peer_cnt == 0) {
+ if (ugd->gl_connected_peer_cnt == 0)
WFD_IF_DEL_ITEM(ugd->conn_wfd_item);
- }
+
__FUNC_EXIT__;
}
ugd->gl_mul_conn_peers_start = NULL;
}
- if (ugd->gl_connected_peer_cnt == 0) {
+ if (ugd->gl_connected_peer_cnt == 0)
WFD_IF_DEL_ITEM(ugd->conn_wfd_item);
- }
if (ugd->display_timer != NULL) {
ecore_timer_del(ugd->display_timer);
wfd_refresh_wifi_direct_state(ugd);
if (ugd->wfd_status == WIFI_DIRECT_STATE_CONNECTING) {
DBG(LOG_INFO, "WIFI_DIRECT_STATE_CONNECTING\n");
- if( ugd->multi_connect_wfd_item != NULL) {
+ if (ugd->multi_connect_wfd_item != NULL) {
DBG(LOG_INFO, "multi_connect_toolbar_item\n");
btn = elm_button_add(ugd->button_layout);
/* Use "bottom" style button */
int no_of_available_dev = 0;
int no_of_conn_failed_dev = 0;
- if (is_free_all_peers) {
+ if (is_free_all_peers)
wfd_ug_view_free_peers(ugd);
- }
if (ugd->gl_failed_peers_start != NULL) {
DBG(LOG_INFO, "These are failed peers, must clear them");
device_type_s *peer_tmp = NULL;
while (peer != NULL) {
peer_tmp = peer->next;
- if(peer->is_alive == false) {
+ if (peer->is_alive == false)
free_gl_peer(start_pos, peer->mac_addr, cnt);
- }
+
peer = peer_tmp;
}
// wfd_check_gl_available_peers(ugd);
- if (ugd->gl_busy_peer_cnt == 0) {
+ if (ugd->gl_busy_peer_cnt == 0)
WFD_IF_DEL_ITEM(ugd->busy_wfd_item);
- }
+
__FUNC_EXIT__;
return;
}
Elm_Object_Item *head = elm_genlist_item_next_get(pre_item);
Elm_Object_Item *item = NULL;
- if(peer_cnt == 0) {
+ if (peer_cnt == 0) {
DBG(LOG_INFO, "first peer [%s] would be added", peer->ssid);
return pre_item;
}
peer_ite = (device_type_s *)elm_object_item_data_get(head);
- if(peer_ite->gl_item != NULL) {
- for(i=0; i < peer_cnt; i++) {
+ if (peer_ite->gl_item != NULL) {
+ for (i = 0; i < peer_cnt; i++) {
if (strcasecmp(peer_ite->ssid, peer->ssid) > 0) {
/* if peer_ite is greater than peer, return previous item */
__FUNC_EXIT__;
memcpy(peer, peer_for_insert, sizeof(device_type_s));
peer->next = NULL;
- if(*start_pos == NULL) {
+ if (*start_pos == NULL) {
*start_pos = peer;
} else {
peer_ite = *start_pos;
- while(peer_ite->next != NULL) {
+ while (peer_ite->next != NULL) {
/* move pointer to the last peer */
peer_ite = peer_ite->next;
}
peer->is_alive = true;
peer->gl_item = elm_genlist_item_insert_after(genlist, itc, (void *)peer, NULL, item,
ELM_GENLIST_ITEM_NONE, callback, (void *)peer);
- if (callback == NULL && peer->gl_item != NULL) {
+ if (callback == NULL && peer->gl_item != NULL)
elm_genlist_item_select_mode_set(peer->gl_item, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
- }
+
__FUNC_EXIT__;
return 0;
}
Elm_Object_Item *item = NULL;
res = wifi_direct_is_group_owner(&is_group_owner);
- if (res == WIFI_DIRECT_ERROR_NONE) {
+ if (res == WIFI_DIRECT_ERROR_NONE)
DBG(LOG_INFO, "is_group_owner=[%d]", is_group_owner);
- }
- if (!ugd->conn_wfd_item) {
+ if (!ugd->conn_wfd_item)
_create_connected_dev_genlist(ugd);
- }
for (i = 0; i < ugd->raw_connected_peer_cnt; i++) {
if (find_peer_in_glist(ugd->gl_conn_peers_start, ugd->raw_connected_peers[i].mac_addr) == NULL) {
ugd->gl_connected_peer_cnt);
res = insert_gl_item(ugd->genlist, item, &peer_conn_itc, &ugd->gl_conn_peers_start,
&ugd->raw_connected_peers[i], NULL);
- if (res != 0) {
+ if (res != 0)
break;
- }
+
ugd->gl_connected_peer_cnt++;
}
}
ugd->multi_connect_wfd_item, ugd->gl_multi_connect_peer_cnt);
res = insert_gl_item(ugd->genlist, item, &peer_itc, &ugd->gl_mul_conn_peers_start,
&ugd->raw_multi_selected_peers[i], NULL);
- if (res != 0) {
+ if (res != 0)
break;
- }
+
ugd->gl_multi_connect_peer_cnt++;
}
}
}
if (no_of_conn_dev == 0 || is_group_owner == TRUE) {
- if (ugd->avlbl_wfd_item == NULL) {
+ if (ugd->avlbl_wfd_item == NULL)
_create_available_dev_genlist(ugd);
- }
+
for (iterator = ugd->raw_discovered_peer_list; iterator; iterator = iterator->next) {
/* Not include the device which is connected with me */
- if (__wfd_is_device_connected_with_me(ugd, (device_type_s *)iterator->data)) {
+ if (__wfd_is_device_connected_with_me(ugd, (device_type_s *)iterator->data))
continue;
- }
+
if (!__wfd_is_device_busy(ugd, (device_type_s *)iterator->data) &&
((device_type_s *)iterator->data)->conn_status != PEER_CONN_STATUS_FAILED_TO_CONNECT &&
((device_type_s *)iterator->data)->conn_status != PEER_CONN_STATUS_CONNECTED) {
/* free busy gl peer, which is available now */
if (find_peer_in_glist(ugd->gl_busy_peers_start, ((device_type_s *)iterator->data)->mac_addr) != NULL) {
free_gl_peer(&ugd->gl_busy_peers_start, ((device_type_s *)iterator->data)->mac_addr, &ugd->gl_busy_peer_cnt);
- if (ugd->gl_busy_peer_cnt == 0) {
+ if (ugd->gl_busy_peer_cnt == 0)
WFD_IF_DEL_ITEM(ugd->busy_wfd_item);
- }
}
- if (find_peer_in_glist(ugd->gl_failed_peers_start, (const char *)((device_type_s *)iterator->data)->mac_addr) != NULL) {
+ if (find_peer_in_glist(ugd->gl_failed_peers_start, (const char *)((device_type_s *)iterator->data)->mac_addr) != NULL)
continue;
- }
peer = find_peer_in_glist(ugd->gl_avlb_peers_start, (const char *)((device_type_s *)iterator->data)->mac_addr);
if (peer == NULL) {
ugd->avlbl_wfd_item, ugd->gl_available_peer_cnt);
res = insert_gl_item(ugd->genlist, item, &peer_itc, &ugd->gl_avlb_peers_start,
(device_type_s *)iterator->data, _gl_peer_sel);
- if (res != 0) {
+ if (res != 0)
break;
- }
+
ugd->gl_available_peer_cnt++;
} else if (no_of_conn_dev > 0 && ((device_type_s *)iterator->data)->is_group_owner == TRUE) {
/* if peer is GO, free it */
wfd_check_gl_conn_peers(ugd);
if (no_of_conn_dev == 0 && no_of_busy_dev > 0) {
- if (ugd->busy_wfd_item == NULL) {
+ if (ugd->busy_wfd_item == NULL)
_create_busy_dev_list(ugd);
- }
for (iterator = ugd->raw_discovered_peer_list; iterator; iterator = iterator->next) {
/* Not include the device which is connected with me */
- if (__wfd_is_device_connected_with_me(ugd, (device_type_s *)iterator->data)) {
+ if (__wfd_is_device_connected_with_me(ugd, (device_type_s *)iterator->data))
continue;
- }
+
if (__wfd_is_device_busy(ugd, (device_type_s *)iterator->data) == TRUE) {
if (find_peer_in_glist(ugd->gl_busy_peers_start, ((device_type_s *)iterator->data)->mac_addr) == NULL) {
if (find_peer_in_glist(ugd->gl_avlb_peers_start,
ugd->gl_busy_peer_cnt);
res = insert_gl_item(ugd->genlist, item, &peer_busy_itc, &ugd->gl_busy_peers_start,
(device_type_s *)iterator->data, _gl_busy_peer_sel);
- if (res != 0) {
+ if (res != 0)
break;
- }
+
ugd->gl_busy_peer_cnt++;
}
}
__wfd_is_any_device_connect_failed(ugd, &no_of_conn_failed_dev);
DBG(LOG_INFO, "conn_failed_dev=[%d]", no_of_conn_failed_dev);
- if (no_of_conn_failed_dev == 0) {
+ if (no_of_conn_failed_dev == 0)
return;
- }
/* add timer for disappearing failed peers after N secs */
if (NULL == ugd->display_timer) {
WFD_RET_IF(ugd == NULL, "Incorrect parameter(NULL)\n");
WFD_RET_IF(ugd->on_off_check == NULL, "on_off_check(NULL)\n");
wfd_refresh_wifi_direct_state(ugd);
- if(ugd->device_name_item != NULL)
+ if (ugd->device_name_item != NULL)
elm_genlist_item_update(ugd->device_name_item);
elm_object_disabled_set(ugd->on_off_check, TRUE);
- if(ugd->disconnect_btn) {
+ if (ugd->disconnect_btn) {
Evas_Object *content;
content = elm_object_part_content_unset(ugd->button_layout, "button.next");
WFD_IF_DEL_OBJ(content);
wfd_refresh_wifi_direct_state(ugd);
if (ugd->wfd_status == WIFI_DIRECT_STATE_DEACTIVATING ||
- ugd->wfd_status == WIFI_DIRECT_STATE_ACTIVATING ) {
+ ugd->wfd_status == WIFI_DIRECT_STATE_ACTIVATING)
elm_object_disabled_set(ugd->on_off_check, TRUE);
- } else {
+ else
elm_object_disabled_set(ugd->on_off_check, FALSE);
- }
- if (ugd->wfd_status > WIFI_DIRECT_STATE_ACTIVATING) {
+
+ if (ugd->wfd_status > WIFI_DIRECT_STATE_ACTIVATING)
elm_check_state_set(ugd->on_off_check, TRUE);
- } else {
+ else
elm_check_state_set(ugd->on_off_check, FALSE);
- }
__FUNC_EXIT__;
}
wifi_direct_initialize();
wifi_direct_get_state(&ugd->wfd_status);
- if (ugd->wfd_status > WIFI_DIRECT_STATE_DEACTIVATING) {
+ if (ugd->wfd_status > WIFI_DIRECT_STATE_DEACTIVATING)
scan_button_create(ugd);
- }
if (ugd->view_type && g_strcmp0(D_(ugd->view_type), D_("IDS_WIFI_BUTTON_MULTI_CONNECT")) == 0) {
int ret = 0;
wifi_direct_destroy_group();
/* release the selected peers */
- for (i = 0; i < ugd->raw_multi_selected_peer_cnt; i++) {
+ for (i = 0; i < ugd->raw_multi_selected_peer_cnt; i++)
memset(&ugd->raw_multi_selected_peers[i], 0x00, sizeof(device_type_s));
- }
ugd->raw_multi_selected_peer_cnt = 0;
ugd->multi_connect_mode = WFD_MULTI_CONNECT_MODE_NONE;
wfd_ug_view_refresh_glitem(ugd->multi_connect_wfd_item);
wfd_ug_update_toolbar(ugd);
- if (ugd->gl_connected_peer_cnt > 0) {
+ if (ugd->gl_connected_peer_cnt > 0)
wfd_client_set_p2p_group_owner_intent(7);
- } else {
+ else
wifi_direct_destroy_group();
- }
- if(ugd->timer_multi_reset > 0) {
+ if (ugd->timer_multi_reset > 0)
g_source_remove(ugd->timer_multi_reset);
- }
+
/* after 30s, remove the failed peers */
ugd->timer_multi_reset = g_timeout_add(30000 /*ms*/,
__wfd_multi_connect_reset_cb, ugd);
- 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;
/*when multi-connect end and auto_exit is true, exit UG*/
- if (ugd->is_auto_exit) {
+ if (ugd->is_auto_exit)
_wfd_ug_auto_exit(ugd);
- }
__FUNC_EXIT__;
return 0;
int j = 0;
device_type_s peer;
- for(i = 0; i < ugd->raw_multi_selected_peer_cnt; i++) {
- for(j = 0; j < ugd->raw_multi_selected_peer_cnt-i-1; j++) {
+ for (i = 0; i < ugd->raw_multi_selected_peer_cnt; i++) {
+ for (j = 0; j < ugd->raw_multi_selected_peer_cnt-i-1; j++) {
if (strcasecmp(ugd->raw_multi_selected_peers[j].ssid, ugd->raw_multi_selected_peers[j + 1].ssid) > 0) {
peer = ugd->raw_multi_selected_peers[j];
ugd->raw_multi_selected_peers[j] = ugd->raw_multi_selected_peers[j + 1];
int res;
// Reset g_source handler..
- 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 (ugd->raw_multi_selected_peer_cnt > 0) {
peer = ugd->multi_conn_dev_list_start;
while (peer != NULL) {
- if(peer->dev_sel_state) {
+ if (peer->dev_sel_state)
count++;
- }
+
peer = peer->next;
}
DBG(LOG_INFO, "MultiSelected Peer Count: %d", count);
peer = ugd->multi_conn_dev_list_start;
count = 0;
while (peer != NULL) {
- if(peer->dev_sel_state) {
+ if (peer->dev_sel_state) {
DBG(LOG_INFO, "peer_name[%s] select state[%d]", peer->ssid, peer->dev_sel_state);
memcpy(&ugd->raw_multi_selected_peers[count], peer, sizeof(device_type_s));
ugd->raw_multi_selected_peers[count].conn_status = PEER_CONN_STATUS_WAIT_FOR_CONNECT;
ugd->is_multi_check_all_selected = TRUE;
- if(event_info != NULL) {
+ if (event_info != NULL) {
Evas_Object *content = elm_object_item_part_content_get(event_info, "elm.icon.2");
chk_box = elm_object_part_content_get(content, "elm.swallow.content");
state = elm_check_state_get(chk_box);
DBG(LOG_INFO, "state = %d \n", state);
- if (chk_box == NULL) {
+ if (chk_box == NULL)
DBG(LOG_INFO, "Check box is null\n");
- }
}
object_type = evas_object_type_get(obj);
if (g_strcmp0(object_type, "elm_genlist") == 0) {
Elm_Object_Item *item = (Elm_Object_Item *)event_info;
- if (item) {
+ if (item)
elm_genlist_item_selected_set(item, EINA_FALSE);
- }
+
DBG(LOG_INFO, "State elm_genlist %d\n", state);
elm_check_state_set(chk_box, !state);
peer->dev_sel_state = !state;
- } else if (g_strcmp0(object_type, "elm_check") == 0){
+ } else if (g_strcmp0(object_type, "elm_check") == 0) {
DBG(LOG_INFO, "elm_check state; %d\n", peer->dev_sel_state);
peer->dev_sel_state = !peer->dev_sel_state;
}
peer = ugd->multi_conn_dev_list_start;
while (peer != NULL) {
- if(peer->dev_sel_state) {
+ if (peer->dev_sel_state) {
is_sel = TRUE;
sel_count++;
} else {
device_type_s *peer = (device_type_s *)data;
char *ssid;
- if (NULL == peer) {
+ if (NULL == peer)
return NULL;
- }
if (!strcmp("elm.text", part)) {
if (strlen(peer->ssid) != 0) {
icon = elm_check_add(icon_layout);
elm_object_style_set(icon, "default/genlist");
evas_object_propagate_events_set(icon, EINA_FALSE);
- if (peer->dev_sel_state == EINA_TRUE) {
+ if (peer->dev_sel_state == EINA_TRUE)
elm_check_state_set(icon, EINA_TRUE);
- }
+
evas_object_smart_callback_add(icon,
"changed", _wfd_gl_multi_sel_cb, (void *)data);
elm_layout_content_set(icon_layout, "elm.swallow.content", icon);
if (ugd->gl_available_dev_cnt_at_multiconn_view > 0) {
peer = ugd->multi_conn_dev_list_start;
while (peer != NULL) {
- if(peer->dev_sel_state) {
+ if (peer->dev_sel_state) {
is_sel = TRUE;
sel_count++;
}
{
__FUNC_ENTER__;
- if (ugd->multiconn_view_genlist == NULL) {
+ if (ugd->multiconn_view_genlist == NULL)
return 0;
- }
ugd->gl_available_dev_cnt_at_multiconn_view = 0;
if (ugd->multi_conn_dev_list_start != NULL) {
if (!ugd->mcview_nodevice_item) {
ugd->mcview_nodevice_item = elm_genlist_item_append(ugd->multiconn_view_genlist, &noitem_itc, (void *)ugd, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
- if(ugd->mcview_nodevice_item != NULL)
+ if (ugd->mcview_nodevice_item != NULL)
elm_genlist_item_select_mode_set(ugd->mcview_nodevice_item , ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
}
int res = 0;
genlist = ugd->multiconn_view_genlist;
- if (ugd->multiconn_view_genlist == NULL) {
+ if (ugd->multiconn_view_genlist == NULL)
return 0;
- }
- if (is_free_all_peers) {
+ if (is_free_all_peers)
wfd_free_multiconnect_device(ugd);
- }
GList *iterator = NULL;
for (iterator = ugd->raw_discovered_peer_list; iterator; iterator = iterator->next) {
device = (device_type_s *)iterator->data;
- if (device->is_connected == FALSE && device->is_group_owner == FALSE) {
+ if (device->is_connected == FALSE && device->is_group_owner == FALSE)
count++;
- }
}
if (count == 0) {
DBG(LOG_INFO, "There are No peers\n");
if (!ugd->mcview_title_item) {
ugd->mcview_title_item = elm_genlist_item_append(genlist, &multi_view_title_itc, ugd, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
- if(ugd->mcview_title_item != NULL)
+ if (ugd->mcview_title_item != NULL)
elm_genlist_item_select_mode_set(ugd->mcview_title_item, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
} else {
wfd_ug_view_refresh_glitem(ugd->mcview_title_item);
item = get_insert_postion(device, ugd->mcview_title_item, ugd->gl_available_dev_cnt_at_multiconn_view);
res = insert_gl_item(genlist, item, &device_itc, &ugd->multi_conn_dev_list_start,
device, _wfd_gl_multi_sel_cb);
- if (res != 0) {
+ if (res != 0)
break;
- }
+
elm_check_state_set(ugd->select_all_icon, EINA_FALSE);
ugd->is_select_all_checked = FALSE;
}
state = elm_check_state_get(ugd->select_all_icon);
- DBG(LOG_INFO, "state = %d",state);
+ DBG(LOG_INFO, "state = %d", state);
if (state == EINA_TRUE) {
if (ugd->is_multi_check_all_selected == FALSE) {
int sel_count = 0;
if (ugd->multiconn_conn_btn) {
peer = ugd->multi_conn_dev_list_start;
while (peer) {
- if(peer->dev_sel_state) {
+ if (peer->dev_sel_state) {
wfd_ug_view_refresh_button(ugd->multiconn_conn_btn, "IDS_WIFI_SK_CONNECT", TRUE);
break;
}
peer = peer->next;
}
- if (!peer) {
+ if (!peer)
wfd_ug_view_refresh_button(ugd->multiconn_conn_btn, "IDS_WIFI_SK_CONNECT", FALSE);
- }
}
btn_text = elm_object_text_get(ugd->multiconn_scan_stop_btn);
elm_naviframe_item_pop_cb_set(navi_item, _multiconnect_view_pop_cb, (void *)ugd);
ugd->select_all_view_genlist = elm_genlist_item_append(genlist,
&select_all_multi_connect_itc, ugd, NULL, ELM_GENLIST_ITEM_NONE,
- wfd_genlist_select_all_check_changed_cb, (void *)ugd );
+ wfd_genlist_select_all_check_changed_cb, (void *)ugd);
btn1 = elm_button_add(ugd->multiconn_layout);
"IDS_WIFI_SK_STOP");
}
elm_object_part_content_set(ugd->multiconn_layout, "button.prev", btn1);
- evas_object_smart_callback_add(btn1, "clicked",_multi_scan_btn_cb, (void *)ugd);
+ evas_object_smart_callback_add(btn1, "clicked", _multi_scan_btn_cb, (void *)ugd);
evas_object_show(btn1);
ugd->multiconn_scan_stop_btn = btn1;
elm_object_domain_translatable_text_set(btn2, PACKAGE,
"IDS_WIFI_SK_CONNECT");
elm_object_part_content_set(ugd->multiconn_layout, "button.next", btn2);
- evas_object_smart_callback_add(btn2, "clicked",_connect_btn_cb, (void *)ugd);
+ evas_object_smart_callback_add(btn2, "clicked", _connect_btn_cb, (void *)ugd);
evas_object_show(btn2);
ugd->multiconn_conn_btn = btn2;
elm_object_disabled_set(ugd->multiconn_conn_btn, EINA_TRUE);
}
int result = -1;
result = wifi_direct_accept_connection(ugd->mac_addr_req);
- if (result != WIFI_DIRECT_ERROR_NONE) {
- DBG(LOG_INFO,"Failed to connect");
- }
+ if (result != WIFI_DIRECT_ERROR_NONE)
+ DBG(LOG_INFO, "Failed to connect");
+
delete_popup(ugd);
__FUNC_EXIT__;
if (ugd->mac_addr_req[0] != '\0') {
result = wifi_direct_reject_connection(ugd->mac_addr_req);
if (result != WIFI_DIRECT_ERROR_NONE)
- DBG(LOG_INFO,"Failed to reject connection");
+ DBG(LOG_INFO, "Failed to reject connection");
} else {
- DBG(LOG_INFO,"No Peer mac address");
+ DBG(LOG_INFO, "No Peer mac address");
}
delete_popup(ugd);
#endif
/* while activating/deactivating, disable the buttons */
- 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);
- }
+
ugd->is_hotspot_locally_disabled = TRUE;
}
}
#endif
/* while activating/deactivating, disable the buttons */
- 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);
- }
}
evas_object_del(ugd->act_popup);
wfd_ug_view_init_genlist(ugd, true);
- if (0 != wfd_client_disconnect(NULL)) {
+ if (0 != wfd_client_disconnect(NULL))
DBG(LOG_ERROR, "Disconnection Failed !!!\n");
- }
ugd->wfd_discovery_status = WIFI_DIRECT_DISCOVERY_SOCIAL_CHANNEL_START;
discover_cb(WIFI_DIRECT_ERROR_NONE, WIFI_DIRECT_DISCOVERY_STARTED, ugd);
wfd_ug_view_init_genlist(ugd, true);
} else {
/* update the connecting icon */
- for (iterator = ugd->raw_discovered_peer_list; iterator; iterator = iterator->next) {
+ for (iterator = ugd->raw_discovered_peer_list; iterator; iterator = iterator->next)
((device_type_s *)iterator->data)->conn_status = PEER_CONN_STATUS_DISCONNECTED;
- }
+
wfd_ug_view_init_genlist(ugd, false);
}
elm_object_domain_translatable_text_set(btn2, PACKAGE,
"IDS_BR_SK_OK");
- switch(popup_type) {
+ switch (popup_type) {
case POPUP_TYPE_HOTSPOT_OFF:
elm_object_domain_translatable_text_set(btn1, PACKAGE,
evas_object_smart_callback_add(btn1, "clicked", _wfd_ug_act_popup_cancel_cb, (void *)ugd);
evas_object_smart_callback_add(btn2, "clicked", _wfd_ug_act_popup_cancel_connect_ok_cb, (void *)ugd);
- } else if (popup_type == POP_TYPE_ACCEPT_CONNECTION ) {
+ } else if (popup_type == POP_TYPE_ACCEPT_CONNECTION) {
evas_object_smart_callback_add(btn1, "clicked",
pushbutton_reject_connect_cb, (void *)ugd);
evas_object_smart_callback_add(btn2, "clicked",
evas_object_del(ugd->warn_popup);
ugd->warn_popup = NULL;
- if (ugd->rename_entry) {
+ if (ugd->rename_entry)
elm_object_focus_set(ugd->rename_entry, EINA_TRUE);
- }
__FUNC_EXIT__;
}
elm_object_domain_translatable_text_set(btn, PACKAGE,
"IDS_BR_SK_OK");
- switch(popup_type) {
+ switch (popup_type) {
case POPUP_TYPE_ACTIVATE_FAIL_POLICY_RESTRICTS:
elm_object_domain_translatable_text_set(ugd->warn_popup, PACKAGE,
"IDS_COM_POP_SECURITY_POLICY_RESTRICTS_USE_OF_WI_FI");
static bool is_space_str(const char *str)
{
while (str) {
- if (*str != '\0' && *str != ' ') {
+ if (*str != '\0' && *str != ' ')
return FALSE;
- } else if (*str == '\0') {
+ else if (*str == '\0')
return TRUE;
- }
+
str++;
}
return TRUE;
WFD_RET_IF(ugd == NULL || obj == NULL, "Incorrect parameter(NULL)\n");
WFD_RET_IF(ugd->rename_button == NULL, "ugd->rename_button(NULL)\n");
- const char *entry_text = NULL;
- char *input_str = NULL;
+ const char *entry_text = NULL;
+ char *input_str = NULL;
bool is_space_string = FALSE;
entry_text = elm_entry_entry_get(obj);
int j = 0;
bool is_unavailable_char_found = true;
- if ((device_name == NULL) || (strlen(device_name) == 0)) {
+ if ((device_name == NULL) || (strlen(device_name) == 0))
return -1;
- }
for (i = 0; i < strlen(device_name); i++) {
if ((device_name[i] >= '0' && device_name[i] <= '9') ||
DBG(LOG_INFO, "New device name:[%s]\n", device_name_str);
_check_device_name(device_name_str);
- if (0 != vconf_set_str(VCONFKEY_SETAPPL_DEVICE_NAME_STR, device_name_str)) {
- DBG(LOG_ERROR, "Set vconf[%s] failed\n",VCONFKEY_SETAPPL_DEVICE_NAME_STR);
- }
+ if (0 != vconf_set_str(VCONFKEY_SETAPPL_DEVICE_NAME_STR, device_name_str))
+ DBG(LOG_ERROR, "Set vconf[%s] failed\n", VCONFKEY_SETAPPL_DEVICE_NAME_STR);
+
#ifdef WFD_ON_OFF_GENLIST
wfd_ug_view_refresh_glitem(ugd->item_wifi_onoff);
#endif
int ret = notification_status_message_post(
D_("IDS_COM_POP_MAXIMUM_NUMBER_OF_CHARACTERS_REACHED"));
- if (ret != NOTIFICATION_ERROR_NONE) {
+ if (ret != NOTIFICATION_ERROR_NONE)
DBG(LOG_ERROR, "notification_status_message_post() ERROR [%d]", ret);
- }
__FUNC_EXIT__;
}
Ecore_IMF_Context *imf_context;
imf_context = (Ecore_IMF_Context*)elm_entry_imf_context_get(entry);
- if (imf_context) {
+ if (imf_context)
ecore_imf_context_input_panel_hide(imf_context);
- }
elm_object_focus_set(entry, EINA_FALSE);
}
{
__FUNC_ENTER__;
- DBG(LOG_INFO,"Part = %s", part);
- if (obj == NULL || part == NULL) {
+ DBG(LOG_INFO, "Part = %s", part);
+ if (obj == NULL || part == NULL)
return NULL;
- }
if (!strcmp("elm.text.multiline", part)) {
char buf[WFD_GLOBALIZATION_STR_LENGTH] = {0, };
/* Entry genlist item */
ugd->rename_entry_itc = elm_genlist_item_class_new();
- if(ugd->rename_entry_itc != NULL) {
+ if (ugd->rename_entry_itc != NULL) {
ugd->rename_entry_itc->item_style = "entry";
ugd->rename_entry_itc->func.text_get = NULL;
ugd->rename_entry_itc->func.content_get = __wfd_main_rename_entry_icon_get;
}
ugd->rename_desc_itc = elm_genlist_item_class_new();
- if(ugd->rename_desc_itc != NULL) {
+ if (ugd->rename_desc_itc != NULL) {
ugd->rename_desc_itc->item_style = WFD_GENLIST_MULTILINE_TEXT_STYLE;
ugd->rename_desc_itc->func.text_get = __wfd_main_rename_desc_label_get;
ugd->rename_desc_itc->func.content_get = NULL;
git = elm_genlist_item_append(genlist, ugd->rename_desc_itc, NULL, NULL,
ELM_GENLIST_ITEM_NONE, NULL, NULL);
- if(git != NULL)
+ if (git != NULL)
elm_genlist_item_select_mode_set(git,
ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
}