Changes in uspace/lib/usbhid/src/hiddescriptor.c [feeac0d:9d58539] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbhid/src/hiddescriptor.c
rfeeac0d r9d58539 41 41 #include <assert.h> 42 42 43 43 /*---------------------------------------------------------------------------*/ 44 44 /* 45 45 * Constants defining current parsing mode for correct parsing of the set of … … 61 61 #define INSIDE_DELIMITER_SET 2 62 62 63 63 /*---------------------------------------------------------------------------*/ 64 64 65 65 /** The new report item flag. Used to determine when the item is completly … … 78 78 #define USB_HID_UNKNOWN_TAG -99 79 79 80 80 /*---------------------------------------------------------------------------*/ 81 81 /** 82 82 * Checks if given collection path is already present in report structure and … … 124 124 } 125 125 126 126 /*---------------------------------------------------------------------------*/ 127 127 /** 128 128 * Initialize the report descriptor parser structure … … 147 147 } 148 148 149 149 /*---------------------------------------------------------------------------*/ 150 150 151 151 /** … … 314 314 return EOK; 315 315 } 316 316 /*---------------------------------------------------------------------------*/ 317 317 /** 318 318 * Finds description of report with given report_id and of given type in … … 333 333 } 334 334 335 list_foreach(report->reports, reports_link, 336 usb_hid_report_description_t, report_des) { 335 usb_hid_report_description_t *report_des = NULL; 336 337 list_foreach(report->reports, report_it) { 338 report_des = list_get_instance(report_it, 339 usb_hid_report_description_t, reports_link); 340 337 341 // if report id not set, return the first of the type 338 342 if(((report_des->report_id == report_id) || (report_id == 0)) && … … 344 348 return NULL; 345 349 } 346 350 /*---------------------------------------------------------------------------*/ 347 351 348 352 /** Parse HID report descriptor. … … 532 536 } 533 537 534 538 /*---------------------------------------------------------------------------*/ 535 539 536 540 /** … … 867 871 return EOK; 868 872 } 869 873 /*---------------------------------------------------------------------------*/ 870 874 871 875 /** … … 888 892 return result; 889 893 } 890 894 /*---------------------------------------------------------------------------*/ 891 895 892 896 /** … … 898 902 void usb_hid_descriptor_print_list(list_t *list) 899 903 { 904 usb_hid_report_field_t *report_item; 905 900 906 if(list == NULL || list_empty(list)) { 901 907 usb_log_debug("\tempty\n"); … … 903 909 } 904 910 905 list_foreach(*list, ritems_link, usb_hid_report_field_t, 906 report_item) { 911 list_foreach(*list, item) { 912 report_item = list_get_instance(item, usb_hid_report_field_t, 913 ritems_link); 914 907 915 usb_log_debug("\t\tOFFSET: %X\n", report_item->offset); 908 916 usb_log_debug("\t\tSIZE: %zu\n", report_item->size); … … 929 937 930 938 usb_log_debug("\n"); 931 } 932 } 933 939 940 } 941 942 } 943 /*---------------------------------------------------------------------------*/ 934 944 935 945 /** … … 941 951 void usb_hid_descriptor_print(usb_hid_report_t *report) 942 952 { 943 if (report == NULL)953 if(report == NULL) { 944 954 return; 945 946 list_foreach(report->reports, reports_link, 947 usb_hid_report_description_t, report_des) { 955 } 956 957 usb_hid_report_description_t *report_des; 958 959 list_foreach(report->reports, report_it) { 960 report_des = list_get_instance(report_it, 961 usb_hid_report_description_t, reports_link); 948 962 usb_log_debug("Report ID: %d\n", report_des->report_id); 949 963 usb_log_debug("\tType: %d\n", report_des->type); … … 958 972 } 959 973 } 960 974 /*---------------------------------------------------------------------------*/ 961 975 962 976 … … 1008 1022 return; 1009 1023 } 1010 1024 /*---------------------------------------------------------------------------*/ 1011 1025 1012 1026 /**
Note:
See TracChangeset
for help on using the changeset viewer.