+
+ /* set rotation */
+ if (elm_win_wm_rotation_supported_get(ugd->win)) {
+ int rots[4] = {0, 90, 180, 270};
+ elm_win_wm_rotation_available_rotations_set(ugd->win, (const int *)(&rots), 4);
+ }
+
+ /* check the input parameters from app at first */
+ ugd->wfds = NULL;
+ ugd->device_filter = -1; /* show all devices */
+ ugd->is_auto_exit = false;
+ ugd->is_multi_connect = true;
+ ugd->is_init_ok = false;
+ ugd->title = strdup(D_("IDS_WIFI_BODY_WI_FI_DIRECT_ABB"));
+
+ if (control) {
+ char *wfds = NULL;
+ char *device_filter = NULL;
+ char *auto_exit = NULL;
+ char *multi_connect = NULL;
+ char *title = NULL;
+ char* viewtype = NULL;
+
+ /*
+ * get the control name
+ * default value: Wi-Fi Direct
+ */
+ ret = app_control_get_extra_data(control, "wfds", &wfds);
+ if (ret == APP_CONTROL_ERROR_NONE && wfds) {
+ DBG_SECURE(LOG_INFO, "Wfds name: %s", wfds);
+ ugd->wfds = strdup(wfds);
+ }
+ WFD_IF_FREE_MEM(wfds);
+
+ ret = app_control_get_extra_data(control, "viewtype", &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);
+
+ /*
+ * get the device filter
+ * default value: NULL
+ */
+ 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))
+ ugd->device_filter = WFD_DEVICE_TYPE_COMPUTER;
+ 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))
+ ugd->device_filter = WFD_DEVICE_TYPE_PRINTER;
+ else if (0 == strncmp(device_filter, "camera", 6))
+ ugd->device_filter = WFD_DEVICE_TYPE_CAMERA;
+ else if (0 == strncmp(device_filter, "storage", 7))
+ ugd->device_filter = WFD_DEVICE_TYPE_STORAGE;
+ 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))
+ ugd->device_filter = WFD_DEVICE_TYPE_DISPLAYS;
+ 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))
+ ugd->device_filter = WFD_DEVICE_TYPE_GAME_DEVICES;
+ else if (0 == strncmp(device_filter, "telephone", 9))
+ ugd->device_filter = WFD_DEVICE_TYPE_TELEPHONE;
+ else if (0 == strncmp(device_filter, "audio", 5))
+ ugd->device_filter = WFD_DEVICE_TYPE_AUDIO;
+ else
+ ugd->device_filter = WFD_DEVICE_TYPE_OTHER;
+ }
+ WFD_IF_FREE_MEM(device_filter);
+
+ /*
+ * get whether support auto exit after connection
+ * default value: false
+ */
+ 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))
+ ugd->is_auto_exit = true;
+ else
+ ugd->is_auto_exit = false;
+ }
+ WFD_IF_FREE_MEM(auto_exit);
+
+ /*
+ * get whether support multi connection,
+ * default value: true
+ */
+ 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))
+ ugd->is_multi_connect = false;
+ else
+ ugd->is_multi_connect = true;
+ }
+ WFD_IF_FREE_MEM(multi_connect);
+
+ /*
+ * get the title of UG
+ * default value: Wi-Fi Direct
+ */
+ ret = app_control_get_extra_data(control, "title_string", &title);
+ if (ret == APP_CONTROL_ERROR_NONE && title) {
+ DBG(LOG_INFO, "Title of UG: %s", title);
+ WFD_IF_FREE_MEM(ugd->title);
+ ugd->title = strdup(title);
+ }
+ WFD_IF_FREE_MEM(title);