Changeset 0bd4810c in mainline for uspace/lib/usb/src/hidparser.c


Ignore:
Timestamp:
2011-03-11T16:24:52Z (14 years ago)
Author:
Matej Klonfar <maklf@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
33382a9
Parents:
9d9ffdd
Message:

Buffer length of parsed input report

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usb/src/hidparser.c

    r9d9ffdd r0bd4810c  
    719719       
    720720}
     721
     722int usb_hid_report_input_length(const usb_hid_report_parser_t *parser,
     723        const usb_hid_report_path_t *path)
     724{
     725        int ret = 0;
     726        link_t *item;
     727        usb_hid_report_item_t *report_item;
     728
     729        item = (&parser->input)->next;
     730        while(&parser->input != item) {
     731                report_item = list_get_instance(item, usb_hid_report_item_t, link);
     732                if(report_item->usage_page == path->usage_page) {
     733                        ret += report_item->count;
     734                }
     735
     736                item = item->next;
     737        }
     738
     739        return ret;
     740}
     741
     742
     743
    721744/**
    722745 * @}
Note: See TracChangeset for help on using the changeset viewer.