mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-03-16 07:20:52 +00:00
btstack_hid_parser: ignore Report ID in Descriptor Usage iterator bit position
This commit is contained in:
parent
a05e6df3cc
commit
619253e6ff
@ -326,7 +326,7 @@ static void btstack_parser_usage_iterator_process_item(btstack_hid_usage_iterato
|
||||
btstack_hid_usage_iterator_handle_global_item(iterator, item);
|
||||
// track record id for report handling, reset report position
|
||||
if (report_id_before != iterator->global_report_id){
|
||||
iterator->report_pos_in_bit = 8u;
|
||||
iterator->report_pos_in_bit = 0u;
|
||||
}
|
||||
break;
|
||||
case Local:
|
||||
@ -491,6 +491,10 @@ void btstack_hid_parser_get_field(btstack_hid_parser_t * parser, uint16_t * usag
|
||||
*usage_page = parser->descriptor_usage_item.usage_page;
|
||||
*usage = parser->descriptor_usage_item.usage;
|
||||
|
||||
// skip optional Report ID
|
||||
if (parser->descriptor_usage_item.report_id != HID_REPORT_ID_UNDEFINED){
|
||||
bit_pos += 8;
|
||||
}
|
||||
|
||||
// read field (up to 32 bit unsigned, up to 31 bit signed - 32 bit signed behaviour is undefined) - check report len
|
||||
bool is_variable = (parser->descriptor_usage_item.descriptor_item.item_value & 2) != 0;
|
||||
|
@ -134,6 +134,8 @@ typedef struct {
|
||||
hid_descriptor_item_t descriptor_item;
|
||||
|
||||
hid_report_type_t report_type;
|
||||
|
||||
// report bit pos does not include the optional Report ID
|
||||
uint16_t report_pos_in_bit;
|
||||
|
||||
// usage pos and usage_page after last main item, used to find next usage
|
||||
|
Loading…
x
Reference in New Issue
Block a user