Changes in uspace/app/usbinfo/hid.c [feeac0d:e2dfa86] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/usbinfo/hid.c
rfeeac0d re2dfa86 36 36 #include <stdio.h> 37 37 #include <str_error.h> 38 #include <usb/debug.h> 38 39 #include <usb/classes/classes.h> 39 40 #include <usb/dev/request.h> … … 50 51 51 52 typedef struct { 52 usb info_device_t *dev;53 usb_device_t *usb_dev; 53 54 hid_dump_type_t dump_type; 54 55 usb_standard_interface_descriptor_t *last_iface; … … 100 101 printf("%sParsed HID report descriptor for interface %d\n", 101 102 get_indent(0), iface_no); 102 list_foreach(report->reports, reports_link, 103 usb_hid_report_description_t, description) { 103 list_foreach(report->reports, report_it) { 104 usb_hid_report_description_t *description = list_get_instance( 105 report_it, usb_hid_report_description_t, reports_link); 104 106 printf("%sReport %d (type %d)\n", get_indent(1), 105 107 (int) description->report_id, 106 108 (int) description->type); 107 list_foreach(description->report_items, ritems_link, 108 usb_hid_report_field_t, field) { 109 list_foreach(description->report_items, item_it) { 110 usb_hid_report_field_t *field = list_get_instance( 111 item_it, usb_hid_report_field_t, ritems_link); 109 112 printf("%sUsage page = 0x%04x Usage = 0x%04x\n", 110 113 get_indent(2), … … 211 214 212 215 retrieve_and_dump_hid_report(context->dump_type, 213 &context->dev->ctrl_pipe, context->last_iface->interface_number,214 report_size);215 } 216 217 218 void dump_hidreport_raw(usb info_device_t *dev)216 usb_device_get_default_pipe(context->usb_dev), 217 context->last_iface->interface_number, report_size); 218 } 219 220 221 void dump_hidreport_raw(usb_device_t *usb_dev) 219 222 { 220 223 descriptor_walk_context_t context = { 221 . dev =dev,224 .usb_dev = usb_dev, 222 225 .dump_type = HID_DUMP_RAW, 223 226 .last_iface = NULL 224 227 }; 225 228 226 usb_dp_walk_simple(dev->full_configuration_descriptor, 227 dev->full_configuration_descriptor_size, 229 usb_dp_walk_simple( 230 usb_device_descriptors(usb_dev)->full_config, 231 usb_device_descriptors(usb_dev)->full_config_size, 228 232 usb_dp_standard_descriptor_nesting, 229 233 descriptor_walk_callback, &context); 230 234 } 231 235 232 void dump_hidreport_usages(usb info_device_t *dev)236 void dump_hidreport_usages(usb_device_t *usb_dev) 233 237 { 234 238 descriptor_walk_context_t context = { 235 . dev =dev,239 .usb_dev = usb_dev, 236 240 .dump_type = HID_DUMP_USAGES, 237 241 .last_iface = NULL 238 242 }; 239 243 240 usb_dp_walk_simple(dev->full_configuration_descriptor, 241 dev->full_configuration_descriptor_size, 244 usb_dp_walk_simple( 245 usb_device_descriptors(usb_dev)->full_config, 246 usb_device_descriptors(usb_dev)->full_config_size, 242 247 usb_dp_standard_descriptor_nesting, 243 248 descriptor_walk_callback, &context);
Note:
See TracChangeset
for help on using the changeset viewer.