Skip to content

Commit

Permalink
numbering of collections is global
Browse files Browse the repository at this point in the history
  • Loading branch information
Marije Baalman committed Oct 6, 2013
1 parent c380943 commit 43743c0
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions hidapi_parser/hidapi_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -286,15 +286,21 @@ int hid_parse_report_descriptor( char* descr_buf, int size, struct hid_device_co
struct hid_device_collection * new_collection = hid_new_collection();
if ( parent_collection->num_collections == 0 ){
parent_collection->first_collection = new_collection;
}
if ( device_collection->num_collections == 0 ){
device_collection->first_collection = new_collection;
} else {
prev_collection->next_collection = new_collection;
}
new_collection->parent_collection = parent_collection;
new_collection->type = next_val;
new_collection->usage_page = current_usage_page;
new_collection->usage_index = current_usage;
new_collection->index = parent_collection->num_collections;
parent_collection->num_collections++;
new_collection->index = device_collection->num_collections;
device_collection->num_collections++;
if ( device_collection != parent_collection ){
parent_collection->num_collections++;
}
parent_collection = new_collection;
collection_nesting++;
#ifdef DEBUG_PARSER
Expand Down

0 comments on commit 43743c0

Please sign in to comment.