Changeset 6513110 in mainline
- Timestamp:
- 2011-04-21T21:01:58Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f240d30
- Parents:
- eb393ad
- Location:
- uspace/drv/usbhid
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/usbhid/kbd/kbddev.c
reb393ad r6513110 304 304 usb_log_debug("Creating output report:\n"); 305 305 306 usb_hid_report_field_t *field = usb_hid_report_get_sibling (hid_dev->parser, NULL, 307 kbd_dev->led_path, 308 USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY | USB_HID_PATH_COMPARE_END, 309 USB_HID_REPORT_TYPE_OUTPUT); 310 while(field != NULL) { 311 312 if((field->usage == USB_HID_LED_NUM_LOCK) && (kbd_dev->mods & KM_NUM_LOCK)){ 306 usb_hid_report_field_t *field = usb_hid_report_get_sibling( 307 hid_dev->report, NULL, kbd_dev->led_path, 308 USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY | USB_HID_PATH_COMPARE_END, 309 USB_HID_REPORT_TYPE_OUTPUT); 310 311 while (field != NULL) { 312 313 if ((field->usage == USB_HID_LED_NUM_LOCK) 314 && (kbd_dev->mods & KM_NUM_LOCK)){ 313 315 field->value = 1; 314 316 } 315 317 316 if((field->usage == USB_HID_LED_CAPS_LOCK) && (kbd_dev->mods & KM_CAPS_LOCK)){ 318 if ((field->usage == USB_HID_LED_CAPS_LOCK) 319 && (kbd_dev->mods & KM_CAPS_LOCK)){ 317 320 field->value = 1; 318 321 } 319 322 320 if((field->usage == USB_HID_LED_SCROLL_LOCK) && (kbd_dev->mods & KM_SCROLL_LOCK)){ 323 if ((field->usage == USB_HID_LED_SCROLL_LOCK) 324 && (kbd_dev->mods & KM_SCROLL_LOCK)){ 321 325 field->value = 1; 322 326 } 323 327 324 field = usb_hid_report_get_sibling (hid_dev->parser, field,325 kbd_dev->led_path,326 USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY | USB_HID_PATH_COMPARE_END,327 USB_HID_REPORT_TYPE_OUTPUT);328 }329 330 int rc = usb_hid_report_output_translate(hid_dev-> parser, 0,328 field = usb_hid_report_get_sibling(hid_dev->report, field, 329 kbd_dev->led_path, USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY 330 | USB_HID_PATH_COMPARE_END, USB_HID_REPORT_TYPE_OUTPUT); 331 } 332 333 // TODO: what about the Report ID? 334 int rc = usb_hid_report_output_translate(hid_dev->report, 0, 331 335 kbd_dev->output_buffer, kbd_dev->output_size); 332 336 … … 336 340 return; 337 341 } 338 339 // TODO: output translating does not work!!340 342 341 343 usb_log_debug("Output report buffer: %s\n", … … 672 674 673 675 uint8_t report_id; 674 int rc = usb_hid_parse_report(hid_dev->parser, buffer, actual_size, &report_id); 676 int rc = usb_hid_parse_report(hid_dev->report, buffer, actual_size, 677 &report_id); 675 678 usb_hid_report_path_set_report_id (path, report_id); 676 usb_hid_report_field_t *field = usb_hid_report_get_sibling(hid_dev->parser, 677 NULL, path, USB_HID_PATH_COMPARE_END | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY, 678 USB_HID_REPORT_TYPE_INPUT); 679 680 usb_hid_report_field_t *field = usb_hid_report_get_sibling( 681 hid_dev->report, NULL, path, USB_HID_PATH_COMPARE_END 682 | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY, USB_HID_REPORT_TYPE_INPUT); 679 683 680 684 usb_hid_report_path_free(path); … … 687 691 // fill in the currently pressed keys 688 692 689 usb_hid_report_field_t *field = usb_hid_report_get_sibling(690 hid_dev->report, NULL, path, USB_HID_PATH_COMPARE_END691 | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY,USB_HID_REPORT_TYPE_INPUT);693 field = usb_hid_report_get_sibling(hid_dev->report, NULL, path, 694 USB_HID_PATH_COMPARE_END | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY, 695 USB_HID_REPORT_TYPE_INPUT); 692 696 unsigned i = 0; 693 697 -
uspace/drv/usbhid/lgtch-ultrax/lgtch-ultrax.c
reb393ad r6513110 83 83 84 84 uint8_t report_id; 85 int rc = usb_hid_parse_report(hid_dev->parser, buffer, buffer_size, &report_id); 85 86 int rc = usb_hid_parse_report(hid_dev->report, buffer, buffer_size, 87 &report_id); 86 88 usb_hid_report_path_set_report_id(path, report_id); 87 89 88 usb_hid_report_field_t *field = usb_hid_report_get_sibling(hid_dev->report, NULL, path, USB_HID_PATH_COMPARE_END , USB_HID_REPORT_TYPE_INPUT); 89 while(field != NULL) { 90 usb_log_debug("KEY VALUE(%X) USAGE(%X)\n", field->value, field->usage); 90 usb_hid_report_field_t *field = usb_hid_report_get_sibling( 91 hid_dev->report, NULL, path, USB_HID_PATH_COMPARE_END , 92 USB_HID_REPORT_TYPE_INPUT); 93 94 while (field != NULL) { 95 usb_log_debug("KEY VALUE(%X) USAGE(%X)\n", field->value, 96 field->usage); 91 97 } 92 98
Note:
See TracChangeset
for help on using the changeset viewer.