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