FREE_STRING(msg->preferred_display_mode);
}
- if (msg->uibc_capability) {
- if (msg->uibc_capability->hidc_cap_list.next) {
- detailed_cap *list = msg->uibc_capability->hidc_cap_list.next;
- detailed_cap *temp = NULL;
- while (list) {
- temp = list->next;
- FREE_STRING(list);
- list = temp;
- }
- }
- FREE_STRING(msg->uibc_capability);
- }
-
- if (msg->uibc_setting) {
- FREE_STRING(msg->uibc_setting);
- }
-
if (msg->standby_resume_capability) {
FREE_STRING(msg->standby_resume_capability);
}
g_string_append_printf(lines, STRING_WFD_CRLF);
}
- if (msg->uibc_capability) {
- g_string_append_printf(lines, STRING_WFD_UIBC_CAPABILITY);
- g_string_append_printf(lines, STRING_WFD_COLON);
- if (msg->uibc_capability->uibcsupported) {
- g_string_append_printf(lines, STRING_WFD_SPACE);
- g_string_append_printf(lines, STRING_WFD_INPUT_CATEGORY_LIST);
- g_string_append_printf(lines, STRING_WFD_EQUALS);
- if (msg->uibc_capability->input_category_list.input_cat) {
- guint32 tempcap = 0;
- if (msg->uibc_capability->input_category_list.input_cat & WFD_UIBC_INPUT_CAT_GENERIC) {
- tempcap |= WFD_UIBC_INPUT_CAT_GENERIC;
- g_string_append_printf(lines, STRING_WFD_GENERIC);
- if (msg->uibc_capability->input_category_list.input_cat != tempcap) {
- g_string_append_printf(lines, STRING_WFD_COMMA STRING_WFD_SPACE);
- }
- }
- if (msg->uibc_capability->input_category_list.input_cat & WFD_UIBC_INPUT_CAT_HIDC) {
- tempcap |= WFD_UIBC_INPUT_CAT_HIDC;
- g_string_append_printf(lines, STRING_WFD_HIDC);
- if (msg->uibc_capability->input_category_list.input_cat != tempcap) {
- g_string_append_printf(lines, STRING_WFD_COMMA STRING_WFD_SPACE);
- }
- }
- } else {
- g_string_append_printf(lines, STRING_WFD_NONE);
- }
- g_string_append_printf(lines, STRING_WFD_SEMI_COLON);
- g_string_append_printf(lines, STRING_WFD_SPACE);
- g_string_append_printf(lines, STRING_WFD_GENERIC_CAP_LIST);
- g_string_append_printf(lines, STRING_WFD_EQUALS);
- if (msg->uibc_capability->generic_cap_list.inp_type) {
- guint32 tempcap = 0;
- if (msg->uibc_capability->generic_cap_list.inp_type & WFD_UIBC_INPUT_TYPE_KEYBOARD) {
- tempcap |= WFD_UIBC_INPUT_TYPE_KEYBOARD;
- g_string_append_printf(lines, STRING_WFD_KEYBOARD);
- if (msg->uibc_capability->generic_cap_list.inp_type != tempcap)
- g_string_append_printf(lines, STRING_WFD_COMMA STRING_WFD_SPACE);
- }
- if (msg->uibc_capability->generic_cap_list.inp_type & WFD_UIBC_INPUT_TYPE_MOUSE) {
- tempcap |= WFD_UIBC_INPUT_TYPE_MOUSE;
- g_string_append_printf(lines, STRING_WFD_MOUSE);
- if (msg->uibc_capability->generic_cap_list.inp_type != tempcap)
- g_string_append_printf(lines, STRING_WFD_COMMA STRING_WFD_SPACE);
- }
- if (msg->uibc_capability->generic_cap_list.inp_type & WFD_UIBC_INPUT_TYPE_SINGLETOUCH) {
- tempcap |= WFD_UIBC_INPUT_TYPE_SINGLETOUCH;
- g_string_append_printf(lines, STRING_WFD_SINGLE_TOUCH);
- if (msg->uibc_capability->generic_cap_list.inp_type != tempcap)
- g_string_append_printf(lines, STRING_WFD_COMMA STRING_WFD_SPACE);
- }
- if (msg->uibc_capability->generic_cap_list.inp_type & WFD_UIBC_INPUT_TYPE_MULTITOUCH) {
- tempcap |= WFD_UIBC_INPUT_TYPE_MULTITOUCH;
- g_string_append_printf(lines, STRING_WFD_MULTI_TOUCH);
- if (msg->uibc_capability->generic_cap_list.inp_type != tempcap)
- g_string_append_printf(lines, STRING_WFD_COMMA STRING_WFD_SPACE);
- }
- if (msg->uibc_capability->generic_cap_list.inp_type & WFD_UIBC_INPUT_TYPE_JOYSTICK) {
- tempcap |= WFD_UIBC_INPUT_TYPE_JOYSTICK;
- g_string_append_printf(lines, STRING_WFD_JOYSTICK);
- if (msg->uibc_capability->generic_cap_list.inp_type != tempcap)
- g_string_append_printf(lines, STRING_WFD_COMMA STRING_WFD_SPACE);
- }
- if (msg->uibc_capability->generic_cap_list.inp_type & WFD_UIBC_INPUT_TYPE_CAMERA) {
- tempcap |= WFD_UIBC_INPUT_TYPE_CAMERA;
- g_string_append_printf(lines, STRING_WFD_CAMERA);
- if (msg->uibc_capability->generic_cap_list.inp_type != tempcap)
- g_string_append_printf(lines, STRING_WFD_COMMA STRING_WFD_SPACE);
- }
- if (msg->uibc_capability->generic_cap_list.inp_type & WFD_UIBC_INPUT_TYPE_GESTURE) {
- tempcap |= WFD_UIBC_INPUT_TYPE_GESTURE;
- g_string_append_printf(lines, STRING_WFD_GESTURE);
- if (msg->uibc_capability->generic_cap_list.inp_type != tempcap)
- g_string_append_printf(lines, STRING_WFD_COMMA STRING_WFD_SPACE);
- }
- if (msg->uibc_capability->generic_cap_list.inp_type & WFD_UIBC_INPUT_TYPE_REMOTECONTROL) {
- tempcap |= WFD_UIBC_INPUT_TYPE_REMOTECONTROL;
- g_string_append_printf(lines, STRING_WFD_REMOTE_CONTROL);
- if (msg->uibc_capability->generic_cap_list.inp_type != tempcap)
- g_string_append_printf(lines, STRING_WFD_COMMA STRING_WFD_SPACE);
- }
- } else {
- g_string_append_printf(lines, STRING_WFD_NONE);
- }
- g_string_append_printf(lines, STRING_WFD_SEMI_COLON);
- g_string_append_printf(lines, STRING_WFD_SPACE);
- g_string_append_printf(lines, STRING_WFD_HIDC_CAP_LIST);
- g_string_append_printf(lines, STRING_WFD_EQUALS);
- if (msg->uibc_capability->hidc_cap_list.cap_count) {
- detailed_cap *temp_cap = msg->uibc_capability->hidc_cap_list.next;
- while (temp_cap) {
- if (temp_cap->p.inp_type == WFD_UIBC_INPUT_TYPE_KEYBOARD) g_string_append_printf(lines, STRING_WFD_KEYBOARD);
- else if (temp_cap->p.inp_type == WFD_UIBC_INPUT_TYPE_MOUSE) g_string_append_printf(lines, STRING_WFD_MOUSE);
- else if (temp_cap->p.inp_type == WFD_UIBC_INPUT_TYPE_SINGLETOUCH) g_string_append_printf(lines, STRING_WFD_SINGLE_TOUCH);
- else if (temp_cap->p.inp_type == WFD_UIBC_INPUT_TYPE_MULTITOUCH) g_string_append_printf(lines, STRING_WFD_MULTI_TOUCH);
- else if (temp_cap->p.inp_type == WFD_UIBC_INPUT_TYPE_JOYSTICK) g_string_append_printf(lines, STRING_WFD_JOYSTICK);
- else if (temp_cap->p.inp_type == WFD_UIBC_INPUT_TYPE_CAMERA) g_string_append_printf(lines, STRING_WFD_CAMERA);
- else if (temp_cap->p.inp_type == WFD_UIBC_INPUT_TYPE_GESTURE) g_string_append_printf(lines, STRING_WFD_GESTURE);
- else if (temp_cap->p.inp_type == WFD_UIBC_INPUT_TYPE_REMOTECONTROL) g_string_append_printf(lines, STRING_WFD_REMOTE_CONTROL);
- g_string_append_printf(lines, STRING_WFD_SLASH);
- if (temp_cap->p.inp_path == WFD_UIBC_INPUT_PATH_INFRARED) g_string_append_printf(lines, STRING_WFD_INFRARED);
- else if (temp_cap->p.inp_path == WFD_UIBC_INPUT_PATH_USB) g_string_append_printf(lines, STRING_WFD_USB);
- else if (temp_cap->p.inp_path == WFD_UIBC_INPUT_PATH_BT) g_string_append_printf(lines, STRING_WFD_BT);
- else if (temp_cap->p.inp_path == WFD_UIBC_INPUT_PATH_ZIGBEE) g_string_append_printf(lines, STRING_WFD_ZIGBEE);
- else if (temp_cap->p.inp_path == WFD_UIBC_INPUT_PATH_WIFI) g_string_append_printf(lines, STRING_WFD_WIFI);
- else if (temp_cap->p.inp_path == WFD_UIBC_INPUT_PATH_NOSP) g_string_append_printf(lines, STRING_WFD_NO_SP);
- temp_cap = temp_cap->next;
- if (temp_cap) g_string_append_printf(lines, STRING_WFD_COMMA STRING_WFD_SPACE);
- }
- } else {
- g_string_append_printf(lines, STRING_WFD_NONE);
- }
- g_string_append_printf(lines, STRING_WFD_SEMI_COLON);
- if (msg->uibc_capability->tcp_port) {
- g_string_append_printf(lines, STRING_WFD_PORT);
- g_string_append_printf(lines, STRING_WFD_EQUALS);
- g_string_append_printf(lines, "%u", msg->uibc_capability->tcp_port);
- } else {
- g_string_append_printf(lines, STRING_WFD_PORT);
- g_string_append_printf(lines, STRING_WFD_EQUALS);
- g_string_append_printf(lines, STRING_WFD_NONE);
- }
- } else {
- g_string_append_printf(lines, STRING_WFD_SPACE);
- g_string_append_printf(lines, STRING_WFD_NONE);
- }
- g_string_append_printf(lines, STRING_WFD_CRLF);
- }
-
- if (msg->uibc_setting) {
- g_string_append_printf(lines, STRING_WFD_UIBC_SETTING);
- g_string_append_printf(lines, STRING_WFD_COLON);
- g_string_append_printf(lines, STRING_WFD_SPACE);
- if (msg->uibc_setting->uibc_setting)
- g_string_append_printf(lines, STRING_WFD_ENABLE);
- else
- g_string_append_printf(lines, STRING_WFD_DISABLE);
- g_string_append_printf(lines, STRING_WFD_CRLF);
- }
-
if (msg->standby_resume_capability) {
g_string_append_printf(lines, STRING_WFD_STANDBY_RESUME_CAPABILITY);
g_string_append_printf(lines, STRING_WFD_COLON);
g_string_append_printf(lines, STRING_WFD_PREFERRED_DISPLAY_MODE);
g_string_append_printf(lines, STRING_WFD_CRLF);
}
- if (msg->uibc_capability) {
- g_string_append_printf(lines, STRING_WFD_UIBC_CAPABILITY);
- g_string_append_printf(lines, STRING_WFD_CRLF);
- }
- if (msg->uibc_setting) {
- g_string_append_printf(lines, STRING_WFD_UIBC_SETTING);
- g_string_append_printf(lines, STRING_WFD_CRLF);
- }
if (msg->standby_resume_capability) {
g_string_append_printf(lines, STRING_WFD_STANDBY_RESUME_CAPABILITY);
g_string_append_printf(lines, STRING_WFD_CRLF);
}
static void
-read_string_char_ended(gchar *dest, guint size, gchar del, gchar *src)
-{
- guint idx = 0;
-
- while (*src != del && *src != '\0') {
- if (idx < size - 1)
- dest[idx++] = *src;
- src++;
- }
-
- if (size > 0)
- dest[idx] = '\0';
-}
-
-static void
read_string_type_and_value(gchar *type, gchar *value, guint tsize, guint vsize, gchar del, gchar *src)
{
guint idx;
gchar temp[8192] = {0};
gchar *p = buffer;
gchar *v = value;
- gchar *result = NULL;
#define WFD_SKIP_SPACE(q) if (*q && g_ascii_isspace(*q)) q++;
#define WFD_SKIP_EQUAL(q) if (*q && *q == '=') q++;
#define WFD_SKIP_COMMA(q) if (*q && g_ascii_ispunct(*q)) q++;
#define WFD_READ_STRING(field) read_string_space_ended(temp, sizeof(temp), v); v += strlen(temp); REPLACE_STRING(field, temp);
-#define WFD_READ_CHAR_END_STRING(field, del) read_string_char_ended(temp, sizeof(temp), del, v); v += strlen(temp); REPLACE_STRING(field, temp);
#define WFD_READ_UINT32(field) read_string_space_ended(temp, sizeof(temp), v); v += strlen(temp); field = strtoul(temp, NULL, 16);
#define WFD_READ_UINT32_DIGIT(field) read_string_space_ended(temp, sizeof(temp), v); v += strlen(temp); field = strtoul(temp, NULL, 10);
WFD_SKIP_SPACE(v);
}
}
- } else if (!g_strcmp0(type, STRING_WFD_UIBC_CAPABILITY)) {
- msg->uibc_capability = g_new0(WFDUibcCapability, 1);
- if (strstr(v, STRING_WFD_INPUT_CATEGORY_LIST)) {
- gchar *tstring = NULL;
- msg->uibc_capability->uibcsupported = TRUE;
- WFD_SKIP_SPACE(v);
- WFD_READ_CHAR_END_STRING(tstring, '=');
- if (!g_strcmp0(tstring, STRING_WFD_INPUT_CATEGORY_LIST)) {
- gchar temp2[8192] = {0};
- guint rem_len = 0, read_len = 0;
- WFD_READ_CHAR_END_STRING(tstring, ';');
- rem_len = strlen(tstring);
- do {
- WFD_SKIP_SPACE(v);
- read_string_char_ended(temp2, 8192, ',', tstring + read_len);
- read_len += (strlen(temp2) + 1);
- if (strstr(temp2, STRING_WFD_GENERIC)) msg->uibc_capability->input_category_list.input_cat |= WFD_UIBC_INPUT_CAT_GENERIC;
- else if (strstr(temp2, STRING_WFD_HIDC)) msg->uibc_capability->input_category_list.input_cat |= WFD_UIBC_INPUT_CAT_HIDC;
- else msg->uibc_capability->input_category_list.input_cat |= WFD_UIBC_INPUT_CAT_UNKNOWN;
- } while (read_len < rem_len);
-
- result = strstr(v, STRING_WFD_GENERIC_CAP_LIST);
- if (result != NULL) {
- memset(temp2, 0, 8192);
- rem_len = 0;
- read_len = 0;
- v = result;
- WFD_READ_CHAR_END_STRING(tstring, '=');
- if (!g_strcmp0(tstring, STRING_WFD_GENERIC_CAP_LIST)) {
- WFD_SKIP_SPACE(v);
- WFD_READ_CHAR_END_STRING(tstring, ';');
- rem_len = strlen(tstring);
- do {
- read_string_char_ended(temp2, 8192, ',', tstring + read_len);
- read_len += (strlen(temp2) + 1);
- if (strstr(temp2, STRING_WFD_KEYBOARD)) msg->uibc_capability->generic_cap_list.inp_type |= WFD_UIBC_INPUT_TYPE_KEYBOARD;
- else if (strstr(temp2, STRING_WFD_MOUSE)) msg->uibc_capability->generic_cap_list.inp_type |= WFD_UIBC_INPUT_TYPE_MOUSE;
- else if (strstr(temp2, STRING_WFD_SINGLE_TOUCH)) msg->uibc_capability->generic_cap_list.inp_type |= WFD_UIBC_INPUT_TYPE_SINGLETOUCH;
- else if (strstr(temp2, STRING_WFD_MULTI_TOUCH)) msg->uibc_capability->generic_cap_list.inp_type |= WFD_UIBC_INPUT_TYPE_MULTITOUCH;
- else if (strstr(temp2, STRING_WFD_JOYSTICK)) msg->uibc_capability->generic_cap_list.inp_type |= WFD_UIBC_INPUT_TYPE_JOYSTICK;
- else if (strstr(temp2, STRING_WFD_CAMERA)) msg->uibc_capability->generic_cap_list.inp_type |= WFD_UIBC_INPUT_TYPE_CAMERA;
- else if (strstr(temp2, STRING_WFD_GESTURE)) msg->uibc_capability->generic_cap_list.inp_type |= WFD_UIBC_INPUT_TYPE_GESTURE;
- else if (strstr(temp2, STRING_WFD_REMOTE_CONTROL)) msg->uibc_capability->generic_cap_list.inp_type |= WFD_UIBC_INPUT_TYPE_REMOTECONTROL;
- else msg->uibc_capability->generic_cap_list.inp_type |= WFD_UIBC_INPUT_TYPE_UNKNOWN;
- } while (read_len < rem_len);
- }
- }
- result = strstr(v, STRING_WFD_HIDC_CAP_LIST);
- if (result != NULL) {
- v = result;
- WFD_SKIP_SPACE(v);
- WFD_READ_CHAR_END_STRING(tstring, '=');
- if (!g_strcmp0(tstring, STRING_WFD_HIDC_CAP_LIST)) {
- gchar inp_type[8192];
- gchar inp_path[8192];
- memset(temp2, 0, 8192);
- rem_len = 0;
- read_len = 0;
- detailed_cap *temp_cap;
- WFD_READ_CHAR_END_STRING(tstring, ';');
- rem_len = strlen(tstring);
- msg->uibc_capability->hidc_cap_list.next = g_new0(detailed_cap, 1);
- temp_cap = msg->uibc_capability->hidc_cap_list.next;
- do {
- msg->uibc_capability->hidc_cap_list.cap_count++;
- read_string_char_ended(temp2, 8192, ',', tstring + read_len);
- read_len += (strlen(temp2) + 1);
- read_string_type_and_value(inp_type, inp_path, sizeof(inp_type), sizeof(inp_path), '/', temp2);
- if (strstr(inp_type, STRING_WFD_KEYBOARD)) temp_cap->p.inp_type = WFD_UIBC_INPUT_TYPE_KEYBOARD;
- else if (strstr(inp_type, STRING_WFD_MOUSE)) temp_cap->p.inp_type = WFD_UIBC_INPUT_TYPE_MOUSE;
- else if (strstr(inp_type, STRING_WFD_SINGLE_TOUCH)) temp_cap->p.inp_type = WFD_UIBC_INPUT_TYPE_SINGLETOUCH;
- else if (strstr(inp_type, STRING_WFD_MULTI_TOUCH)) temp_cap->p.inp_type = WFD_UIBC_INPUT_TYPE_MULTITOUCH;
- else if (strstr(inp_type, STRING_WFD_JOYSTICK)) temp_cap->p.inp_type = WFD_UIBC_INPUT_TYPE_JOYSTICK;
- else if (strstr(inp_type, STRING_WFD_CAMERA)) temp_cap->p.inp_type = WFD_UIBC_INPUT_TYPE_CAMERA;
- else if (strstr(inp_type, STRING_WFD_GESTURE)) temp_cap->p.inp_type = WFD_UIBC_INPUT_TYPE_GESTURE;
- else if (strstr(inp_type, STRING_WFD_REMOTE_CONTROL)) temp_cap->p.inp_type = WFD_UIBC_INPUT_TYPE_REMOTECONTROL;
- else temp_cap->p.inp_type = WFD_UIBC_INPUT_TYPE_UNKNOWN;
-
- if (strstr(inp_path, STRING_WFD_INFRARED)) temp_cap->p.inp_path = WFD_UIBC_INPUT_PATH_INFRARED;
- else if (strstr(inp_path, STRING_WFD_USB)) temp_cap->p.inp_path = WFD_UIBC_INPUT_PATH_USB;
- else if (strstr(inp_path, STRING_WFD_BT)) temp_cap->p.inp_path = WFD_UIBC_INPUT_PATH_BT;
- else if (strstr(inp_path, STRING_WFD_ZIGBEE)) temp_cap->p.inp_path = WFD_UIBC_INPUT_PATH_ZIGBEE;
- else if (strstr(inp_path, STRING_WFD_WIFI)) temp_cap->p.inp_path = WFD_UIBC_INPUT_PATH_WIFI;
- else if (strstr(inp_path, STRING_WFD_NO_SP)) temp_cap->p.inp_path = WFD_UIBC_INPUT_PATH_NOSP;
- else temp_cap->p.inp_path = WFD_UIBC_INPUT_PATH_UNKNOWN;
- if (read_len < rem_len) {
- temp_cap->next = g_new0(detailed_cap, 1);
- temp_cap = temp_cap->next;
- }
- } while (read_len < rem_len);
- }
- }
- result = strstr(v, STRING_WFD_PORT);
- if (result != NULL) {
- v = result;
- WFD_READ_CHAR_END_STRING(tstring, '=');
- if (!g_strcmp0(tstring, STRING_WFD_PORT)) {
- WFD_SKIP_EQUAL(v);
- WFD_READ_CHAR_END_STRING(tstring, ';');
- if (!strstr(tstring, STRING_WFD_NONE)) {
- msg->uibc_capability->tcp_port = strtoul(tstring, NULL, 10);
- }
- }
- }
- }
- } else if (strstr(v, STRING_WFD_NONE)) {
- msg->uibc_capability->uibcsupported = FALSE;
- }
- } else if (!g_strcmp0(type, STRING_WFD_UIBC_SETTING)) {
- msg->uibc_setting = g_new0(WFDUibcSetting, 1);
- if (strlen(v)) {
- WFD_SKIP_SPACE(v);
- if (!g_strcmp0(v, STRING_WFD_ENABLE))
- msg->uibc_setting->uibc_setting = TRUE;
- else
- msg->uibc_setting->uibc_setting = FALSE;
- }
} else if (!g_strcmp0(type, STRING_WFD_STANDBY_RESUME_CAPABILITY)) {
msg->standby_resume_capability = g_new0(WFDStandbyResumeCapability, 1);
if (strlen(v)) {
wfd_debug(STRING_WFD_PREFERRED_DISPLAY_MODE);
}
- if (msg->uibc_capability) {
- wfd_debug("wfd_uibc_capability \r");
- wfd_debug("input category list:");
- if (msg->uibc_capability->input_category_list.input_cat & WFD_UIBC_INPUT_CAT_GENERIC)
- wfd_debug(STRING_WFD_GENERIC);
- if (msg->uibc_capability->input_category_list.input_cat & WFD_UIBC_INPUT_CAT_HIDC)
- wfd_debug(STRING_WFD_HIDC);
- if (!msg->uibc_capability->input_category_list.input_cat)
- wfd_debug(STRING_WFD_NONE);
- if (msg->uibc_capability->input_category_list.input_cat & WFD_UIBC_INPUT_CAT_GENERIC) {
- wfd_debug("generic cap list: ");
- if (msg->uibc_capability->generic_cap_list.inp_type & WFD_UIBC_INPUT_TYPE_KEYBOARD)
- wfd_debug("keyboard ");
- if (msg->uibc_capability->generic_cap_list.inp_type & WFD_UIBC_INPUT_TYPE_MOUSE)
- wfd_debug("mouse ");
- if (msg->uibc_capability->generic_cap_list.inp_type & WFD_UIBC_INPUT_TYPE_SINGLETOUCH)
- wfd_debug("single-touch ");
- if (msg->uibc_capability->generic_cap_list.inp_type & WFD_UIBC_INPUT_TYPE_MULTITOUCH)
- wfd_debug("multi-touch ");
- if (msg->uibc_capability->generic_cap_list.inp_type & WFD_UIBC_INPUT_TYPE_JOYSTICK)
- wfd_debug("joystick ");
- if (msg->uibc_capability->generic_cap_list.inp_type & WFD_UIBC_INPUT_TYPE_CAMERA)
- wfd_debug("camera ");
- if (msg->uibc_capability->generic_cap_list.inp_type & WFD_UIBC_INPUT_TYPE_GESTURE)
- wfd_debug("gesture ");
- if (msg->uibc_capability->generic_cap_list.inp_type & WFD_UIBC_INPUT_TYPE_REMOTECONTROL)
- wfd_debug("remote control ");
- if (!msg->uibc_capability->generic_cap_list.inp_type)
- wfd_debug("none ");
- }
- if (msg->uibc_capability->input_category_list.input_cat & WFD_UIBC_INPUT_CAT_HIDC) {
- wfd_debug("hidc cap list:");
- if (msg->uibc_capability->hidc_cap_list.cap_count) {
- detailed_cap *temp_cap = msg->uibc_capability->hidc_cap_list.next;
- while (temp_cap) {
- if (temp_cap->p.inp_type & WFD_UIBC_INPUT_TYPE_KEYBOARD) {
- wfd_debug("keyboard ");
- } else if (temp_cap->p.inp_type & WFD_UIBC_INPUT_TYPE_MOUSE) {
- wfd_debug("mouse ");
- } else if (temp_cap->p.inp_type & WFD_UIBC_INPUT_TYPE_SINGLETOUCH) {
- wfd_debug("single-touch ");
- } else if (temp_cap->p.inp_type & WFD_UIBC_INPUT_TYPE_MULTITOUCH) {
- wfd_debug("multi-touch ");
- } else if (temp_cap->p.inp_type & WFD_UIBC_INPUT_TYPE_JOYSTICK) {
- wfd_debug("joystick ");
- } else if (temp_cap->p.inp_type & WFD_UIBC_INPUT_TYPE_CAMERA) {
- wfd_debug("camera ");
- } else if (temp_cap->p.inp_type & WFD_UIBC_INPUT_TYPE_GESTURE) {
- wfd_debug("gesture ");
- } else if (temp_cap->p.inp_type & WFD_UIBC_INPUT_TYPE_REMOTECONTROL) {
- wfd_debug("remote control ");
- } else if (!temp_cap->p.inp_type) {
- wfd_debug("none ");
- }
- if (temp_cap->p.inp_path & WFD_UIBC_INPUT_PATH_INFRARED) {
- wfd_debug(STRING_WFD_INFRARED);
- } else if (temp_cap->p.inp_path & WFD_UIBC_INPUT_PATH_USB) {
- wfd_debug(STRING_WFD_USB);
- } else if (temp_cap->p.inp_path & WFD_UIBC_INPUT_PATH_BT) {
- wfd_debug(STRING_WFD_BT);
- } else if (temp_cap->p.inp_path & WFD_UIBC_INPUT_PATH_WIFI) {
- wfd_debug(STRING_WFD_WIFI);
- } else if (temp_cap->p.inp_path & WFD_UIBC_INPUT_PATH_ZIGBEE) {
- wfd_debug(STRING_WFD_ZIGBEE);
- } else if (temp_cap->p.inp_path & WFD_UIBC_INPUT_PATH_NOSP) {
- wfd_debug(STRING_WFD_NO_SP);
- } else if (!temp_cap->p.inp_path) {
- wfd_debug(STRING_WFD_NONE);
- }
- temp_cap = temp_cap->next;
- }
- }
- }
- if (msg->uibc_capability->tcp_port)
- wfd_debug("tcp port:%u", msg->uibc_capability->tcp_port);
- if (!msg->uibc_capability->tcp_port)
- wfd_debug("tcp port: none");
- }
-
- if (msg->uibc_setting) {
- wfd_debug("wfd_uibc_setting: ");
- if (msg->uibc_setting->uibc_setting) {
- wfd_debug("true");
- } else wfd_debug("false");
- }
-
if (msg->standby_resume_capability) {
wfd_debug(STRING_WFD_STANDBY_RESUME_CAPABILITY);
}
return WFD_OK;
}
-WFDResult wfdconfig_set_uibc_capability(WFDMessage *msg, guint32 input_category, guint32 inp_type, WFDHIDCTypePathPair *inp_pair,
- guint32 inp_type_path_count, guint32 tcp_port)
-{
- g_return_val_if_fail(msg != NULL, WFD_EINVAL);
- if (!msg->uibc_capability) msg->uibc_capability = g_new0(WFDUibcCapability, 1);
- msg->uibc_capability->uibcsupported = TRUE;
- msg->uibc_capability->input_category_list.input_cat = input_category;
- msg->uibc_capability->generic_cap_list.inp_type = inp_type;
- msg->uibc_capability->hidc_cap_list.cap_count = inp_type_path_count;
- if (msg->uibc_capability->hidc_cap_list.cap_count) {
- detailed_cap *temp_cap;
- guint i = 0;
- msg->uibc_capability->hidc_cap_list.next = g_new0(detailed_cap, 1);
- temp_cap = msg->uibc_capability->hidc_cap_list.next;
- for (; i < inp_type_path_count;) {
- temp_cap->p.inp_type = inp_pair[i].inp_type;
- temp_cap->p.inp_path = inp_pair[i].inp_path;
- i++;
- if (i < inp_type_path_count) {
- temp_cap->next = g_new0(detailed_cap, 1);
- temp_cap = temp_cap->next;
- }
- }
- }
- msg->uibc_capability->tcp_port = tcp_port;
- return WFD_OK;
-}
-
-WFDResult wfdconfig_get_uibc_capability(WFDMessage *msg, guint32 *input_category, guint32 *inp_type, WFDHIDCTypePathPair **inp_pair,
- guint32 *inp_type_path_count, guint32 *tcp_port)
-{
- g_return_val_if_fail(msg != NULL, WFD_EINVAL);
- if (msg->uibc_capability && msg->uibc_capability->uibcsupported) {
- *input_category = msg->uibc_capability->input_category_list.input_cat;
- *inp_type = msg->uibc_capability->generic_cap_list.inp_type;
- *inp_type_path_count = msg->uibc_capability->hidc_cap_list.cap_count;
- if (msg->uibc_capability->hidc_cap_list.cap_count) {
- detailed_cap *temp_cap;
- guint i = 0;
- *inp_pair = g_new0(WFDHIDCTypePathPair, msg->uibc_capability->hidc_cap_list.cap_count);
- temp_cap = msg->uibc_capability->hidc_cap_list.next;
- while (temp_cap) {
- (*(inp_pair))[i].inp_type = temp_cap->p.inp_type;
- (*(inp_pair))[i].inp_path = temp_cap->p.inp_path;
- temp_cap = temp_cap->next;
- i++;
- }
- }
- *tcp_port = msg->uibc_capability->tcp_port;
- }
- return WFD_OK;
-}
-
-WFDResult wfdconfig_set_uibc_status(WFDMessage *msg, gboolean uibc_enable)
-{
- g_return_val_if_fail(msg != NULL, WFD_EINVAL);
- if (!msg->uibc_setting) msg->uibc_setting = g_new0(WFDUibcSetting, 1);
- msg->uibc_setting->uibc_setting = uibc_enable;
- return WFD_OK;
-}
-
-WFDResult wfdconfig_get_uibc_status(WFDMessage *msg, gboolean *uibc_enable)
-{
- g_return_val_if_fail(msg != NULL, WFD_EINVAL);
- if (msg->uibc_setting) *uibc_enable = msg->uibc_setting->uibc_setting;
- return WFD_OK;
-}
#ifdef STANDBY_RESUME_CAPABILITY
WFDResult wfdconfig_set_standby_resume_capability(WFDMessage *msg, gboolean supported)
{