Ignore:
File:
1 edited

Legend:

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

    r1be39e9 r3b5d5b9d  
    4141#include <assert.h>
    4242
    43 
    44 #define OUTSIDE_DELIMITER_SET   0
    45 #define START_DELIMITER_SET     1
    46 #define INSIDE_DELIMITER_SET    2
    47        
    4843/** The new report item flag. Used to determine when the item is completly
    4944 * configured and should be added to the report structure
     
    272267                return ENOMEM;
    273268        }
    274         usb_hid_report_path_append_item(usage_path, 0, 0);     
    275269       
    276270        while(i<size){ 
     
    437431int usb_hid_report_parse_main_tag(uint8_t tag, const uint8_t *data, size_t item_size,
    438432                             usb_hid_report_item_t *report_item, usb_hid_report_path_t *usage_path)
    439 {
    440         usb_hid_report_usage_path_t *path_item;
    441        
     433{               
    442434        switch(tag)
    443435        {
     
    450442                       
    451443                case USB_HID_REPORT_TAG_COLLECTION:
    452                         // store collection atributes
    453                         path_item = list_get_instance(usage_path->head.prev, usb_hid_report_usage_path_t, link);
    454                         path_item->flags = *data;       
    455                        
    456                         // set last item
    457                         usb_hid_report_set_last_item(usage_path, USB_HID_TAG_CLASS_GLOBAL, report_item->usage_page);
    458                         usb_hid_report_set_last_item(usage_path, USB_HID_TAG_CLASS_LOCAL, report_item->usages[report_item->usages_count-1]);
    459                        
    460                         // append the new one which will be set by common
    461                         // usage/usage page
    462                         usb_hid_report_path_append_item(usage_path, report_item->usage_page, report_item->usages[report_item->usages_count-1]);
     444                        // TODO usage_path->flags = *data;
     445                        usb_hid_report_path_append_item(usage_path, report_item->usage_page, report_item->usages[report_item->usages_count-1]);                                         
    463446                        usb_hid_report_reset_local_items (report_item);
    464447                        return USB_HID_NO_ACTION;
     
    551534                             usb_hid_report_item_t *report_item, usb_hid_report_path_t *usage_path)
    552535{
    553         switch(tag) {
     536        switch(tag)
     537        {
    554538                case USB_HID_REPORT_TAG_USAGE:
    555                         switch(report_item->in_delimiter) {
    556                                 case INSIDE_DELIMITER_SET:
    557                                         // nothing to do
    558                                         break;
    559                                 case START_DELIMITER_SET:
    560                                         report_item->in_delimiter = INSIDE_DELIMITER_SET;
    561                                 case OUTSIDE_DELIMITER_SET:
    562                                         report_item->usages[report_item->usages_count] = usb_hid_report_tag_data_uint32(data,item_size);
    563                                         report_item->usages_count++;
    564                                         break;
    565                         }
     539                        report_item->usages[report_item->usages_count] = usb_hid_report_tag_data_uint32(data,item_size);
     540                        report_item->usages_count++;
    566541                        break;
    567542                case USB_HID_REPORT_TAG_USAGE_MINIMUM:
     
    604579                        break;                 
    605580                case USB_HID_REPORT_TAG_DELIMITER:
    606                         report_item->in_delimiter = usb_hid_report_tag_data_uint32(data,item_size);
    607                         break;
    608 
     581                        //report_item->delimiter = usb_hid_report_tag_data_uint32(data,item_size);
     582                        //TODO:
     583                        //      DELIMITER STUFF
     584                        break;
     585               
    609586                default:
    610587                        return USB_HID_NO_ACTION;
    611588        }
    612 
     589       
    613590        return EOK;
    614591}
Note: See TracChangeset for help on using the changeset viewer.