Changeset a1732929 in mainline for uspace/lib/usbhid
- Timestamp:
- 2018-01-15T17:04:34Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 9ff99e8
- Parents:
- c1a966e
- git-author:
- Ondřej Hlavatý <aearsis@…> (2018-01-15 17:04:32)
- git-committer:
- Ondřej Hlavatý <aearsis@…> (2018-01-15 17:04:34)
- Location:
- uspace/lib/usbhid/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbhid/src/hiddescriptor.c
rc1a966e ra1732929 881 881 { 882 882 if(list == NULL || list_empty(list)) { 883 usb_log_debug("\tempty \n");883 usb_log_debug("\tempty"); 884 884 return; 885 885 } … … 887 887 list_foreach(*list, ritems_link, usb_hid_report_field_t, 888 888 report_item) { 889 usb_log_debug("\t\tOFFSET: %u \n", report_item->offset);890 usb_log_debug("\t\tSIZE: %zu \n", report_item->size);891 usb_log_debug("\t\tLOGMIN: %d \n",889 usb_log_debug("\t\tOFFSET: %u", report_item->offset); 890 usb_log_debug("\t\tSIZE: %zu", report_item->size); 891 usb_log_debug("\t\tLOGMIN: %d", 892 892 report_item->logical_minimum); 893 usb_log_debug("\t\tLOGMAX: %d \n",893 usb_log_debug("\t\tLOGMAX: %d", 894 894 report_item->logical_maximum); 895 usb_log_debug("\t\tPHYMIN: %d \n",895 usb_log_debug("\t\tPHYMIN: %d", 896 896 report_item->physical_minimum); 897 usb_log_debug("\t\tPHYMAX: %d \n",897 usb_log_debug("\t\tPHYMAX: %d", 898 898 report_item->physical_maximum); 899 usb_log_debug("\t\ttUSAGEMIN: %X \n",899 usb_log_debug("\t\ttUSAGEMIN: %X", 900 900 report_item->usage_minimum); 901 usb_log_debug("\t\tUSAGEMAX: %X \n",901 usb_log_debug("\t\tUSAGEMAX: %X", 902 902 report_item->usage_maximum); 903 usb_log_debug("\t\tUSAGES COUNT: %zu \n",903 usb_log_debug("\t\tUSAGES COUNT: %zu", 904 904 report_item->usages_count); 905 905 906 usb_log_debug("\t\tVALUE: %X \n", report_item->value);907 usb_log_debug("\t\ttUSAGE: %X \n", report_item->usage);908 usb_log_debug("\t\tUSAGE PAGE: %X \n", report_item->usage_page);906 usb_log_debug("\t\tVALUE: %X", report_item->value); 907 usb_log_debug("\t\ttUSAGE: %X", report_item->usage); 908 usb_log_debug("\t\tUSAGE PAGE: %X", report_item->usage_page); 909 909 910 910 usb_hid_print_usage_path(report_item->collection_path); 911 912 usb_log_debug("\n");913 911 } 914 912 } … … 928 926 list_foreach(report->reports, reports_link, 929 927 usb_hid_report_description_t, report_des) { 930 usb_log_debug("Report ID: %d \n", report_des->report_id);931 usb_log_debug("\tType: %d \n", report_des->type);932 usb_log_debug("\tLength: %zu \n", report_des->bit_length);933 usb_log_debug("\tB Size: %zu \n",928 usb_log_debug("Report ID: %d", report_des->report_id); 929 usb_log_debug("\tType: %d", report_des->type); 930 usb_log_debug("\tLength: %zu", report_des->bit_length); 931 usb_log_debug("\tB Size: %zu", 934 932 usb_hid_report_byte_size(report, 935 933 report_des->report_id, 936 934 report_des->type)); 937 usb_log_debug("\tItems: %zu \n", report_des->item_length);935 usb_log_debug("\tItems: %zu", report_des->item_length); 938 936 939 937 usb_hid_descriptor_print_list(&report_des->report_items); -
uspace/lib/usbhid/src/hidparser.c
rc1a966e ra1732929 353 353 length = report_item->size; 354 354 355 usb_log_debug("\ttranslated value: %x \n", value);355 usb_log_debug("\ttranslated value: %x", value); 356 356 357 357 if ((offset / 8) == ((offset + length - 1) / 8)) { -
uspace/lib/usbhid/src/hidpath.c
rc1a966e ra1732929 173 173 void usb_hid_print_usage_path(usb_hid_report_path_t *path) 174 174 { 175 usb_log_debug("USAGE_PATH FOR RId(%d): \n", path->report_id);176 usb_log_debug("\tLENGTH: %d \n", path->depth);175 usb_log_debug("USAGE_PATH FOR RId(%d):", path->report_id); 176 usb_log_debug("\tLENGTH: %d", path->depth); 177 177 178 178 list_foreach(path->items, rpath_items_link, 179 179 usb_hid_report_usage_path_t, path_item) { 180 180 181 usb_log_debug("\tUSAGE_PAGE: %X \n", path_item->usage_page);182 usb_log_debug("\tUSAGE: %X \n", path_item->usage);183 usb_log_debug("\tFLAGS: %d \n", path_item->flags);181 usb_log_debug("\tUSAGE_PAGE: %X", path_item->usage_page); 182 usb_log_debug("\tUSAGE: %X", path_item->usage); 183 usb_log_debug("\tFLAGS: %d", path_item->flags); 184 184 } 185 185 } -
uspace/lib/usbhid/src/hidreport.c
rc1a966e ra1732929 84 84 85 85 if (d == NULL) { 86 usb_log_error("The %d. interface descriptor not found! \n",86 usb_log_error("The %d. interface descriptor not found!", 87 87 usb_device_get_iface_number(dev)); 88 88 return ENOENT; … … 104 104 105 105 if (d == NULL) { 106 usb_log_fatal("No HID descriptor found! \n");106 usb_log_fatal("No HID descriptor found!"); 107 107 return ENOENT; 108 108 } … … 130 130 } 131 131 132 usb_log_debug("Getting Report descriptor, expected size: %u \n", length);132 usb_log_debug("Getting Report descriptor, expected size: %u", length); 133 133 134 134 /* … … 156 156 *size = length; 157 157 158 usb_log_debug("Done. \n");158 usb_log_debug("Done."); 159 159 160 160 return EOK; … … 178 178 179 179 if (rc != EOK) { 180 usb_log_error("Problem with getting Report descriptor: %s. \n",180 usb_log_error("Problem with getting Report descriptor: %s.", 181 181 str_error(rc)); 182 182 if (*report_desc != NULL) { … … 191 191 rc = usb_hid_parse_report_descriptor(report, *report_desc, *report_size); 192 192 if (rc != EOK) { 193 usb_log_error("Problem parsing Report descriptor: %s. \n",193 usb_log_error("Problem parsing Report descriptor: %s.", 194 194 str_error(rc)); 195 195 free(*report_desc); -
uspace/lib/usbhid/src/hidreq.c
rc1a966e ra1732929 62 62 { 63 63 if (ctrl_pipe == NULL) { 64 usb_log_warning("usbhid_req_set_report(): no pipe given. \n");64 usb_log_warning("usbhid_req_set_report(): no pipe given."); 65 65 return EINVAL; 66 66 } … … 82 82 value |= (type << 8); 83 83 84 usb_log_debug("Sending Set Report request to the device. \n");84 usb_log_debug("Sending Set Report request to the device."); 85 85 86 86 rc = usb_control_request_set(ctrl_pipe, … … 112 112 { 113 113 if (ctrl_pipe == NULL) { 114 usb_log_warning("usbhid_req_set_report(): no pipe given. \n");114 usb_log_warning("usbhid_req_set_report(): no pipe given."); 115 115 return EINVAL; 116 116 } … … 160 160 { 161 161 if (ctrl_pipe == NULL) { 162 usb_log_warning("usbhid_req_set_report(): no pipe given. \n");162 usb_log_warning("usbhid_req_set_report(): no pipe given."); 163 163 return EINVAL; 164 164 } … … 215 215 { 216 216 if (ctrl_pipe == NULL) { 217 usb_log_warning("usbhid_req_set_report(): no pipe given. \n");217 usb_log_warning("usbhid_req_set_report(): no pipe given."); 218 218 return EINVAL; 219 219 } … … 235 235 value |= (type << 8); 236 236 237 usb_log_debug("Sending Get Report request to the device. \n");237 usb_log_debug("Sending Get Report request to the device."); 238 238 239 239 rc = usb_control_request_get(ctrl_pipe, … … 266 266 { 267 267 if (ctrl_pipe == NULL) { 268 usb_log_warning("usbhid_req_set_report(): no pipe given. \n");268 usb_log_warning("usbhid_req_set_report(): no pipe given."); 269 269 return EINVAL; 270 270 } … … 300 300 301 301 if (actual_size != 1) { 302 usb_log_warning("Wrong data size: %zu, expected: 1. \n",302 usb_log_warning("Wrong data size: %zu, expected: 1.", 303 303 actual_size); 304 304 return ELIMIT; … … 327 327 { 328 328 if (ctrl_pipe == NULL) { 329 usb_log_warning("usbhid_req_set_report(): no pipe given. \n");329 usb_log_warning("usbhid_req_set_report(): no pipe given."); 330 330 return EINVAL; 331 331 } … … 363 363 364 364 if (actual_size != 1) { 365 usb_log_warning("Wrong data size: %zu, expected: 1. \n",365 usb_log_warning("Wrong data size: %zu, expected: 1.", 366 366 actual_size); 367 367 return ELIMIT;
Note:
See TracChangeset
for help on using the changeset viewer.