Changes in uspace/app/usbinfo/hid.c [feeac0d:a1732929] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/usbinfo/hid.c
rfeeac0d ra1732929 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; … … 140 141 raw_report, report_size, &actual_report_size); 141 142 if (rc != EOK) { 142 usb_log_error("Failed to retrieve HID report descriptor: %s. \n",143 usb_log_error("Failed to retrieve HID report descriptor: %s.", 143 144 str_error(rc)); 144 145 free(raw_report); … … 149 150 rc = usb_hid_parse_report_descriptor(&report, raw_report, report_size); 150 151 if (rc != EOK) { 151 usb_log_error("Failed to part report descriptor: %s. \n",152 usb_log_error("Failed to part report descriptor: %s.", 152 153 str_error(rc)); 153 154 } … … 211 212 212 213 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)214 usb_device_get_default_pipe(context->usb_dev), 215 context->last_iface->interface_number, report_size); 216 } 217 218 219 void dump_hidreport_raw(usb_device_t *usb_dev) 219 220 { 220 221 descriptor_walk_context_t context = { 221 . dev =dev,222 .usb_dev = usb_dev, 222 223 .dump_type = HID_DUMP_RAW, 223 224 .last_iface = NULL 224 225 }; 225 226 226 usb_dp_walk_simple(dev->full_configuration_descriptor, 227 dev->full_configuration_descriptor_size, 227 usb_dp_walk_simple( 228 usb_device_descriptors(usb_dev)->full_config, 229 usb_device_descriptors(usb_dev)->full_config_size, 228 230 usb_dp_standard_descriptor_nesting, 229 231 descriptor_walk_callback, &context); 230 232 } 231 233 232 void dump_hidreport_usages(usb info_device_t *dev)234 void dump_hidreport_usages(usb_device_t *usb_dev) 233 235 { 234 236 descriptor_walk_context_t context = { 235 . dev =dev,237 .usb_dev = usb_dev, 236 238 .dump_type = HID_DUMP_USAGES, 237 239 .last_iface = NULL 238 240 }; 239 241 240 usb_dp_walk_simple(dev->full_configuration_descriptor, 241 dev->full_configuration_descriptor_size, 242 usb_dp_walk_simple( 243 usb_device_descriptors(usb_dev)->full_config, 244 usb_device_descriptors(usb_dev)->full_config_size, 242 245 usb_dp_standard_descriptor_nesting, 243 246 descriptor_walk_callback, &context);
Note:
See TracChangeset
for help on using the changeset viewer.