mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-03-01 01:13:23 +00:00
btstack_hid_parser: return false on parsing error in btstack_hid_get_report_size_for_id
This commit is contained in:
parent
76fa2448e1
commit
3a1d529668
@ -443,7 +443,10 @@ int btstack_hid_get_report_size_for_id(int report_id, hid_report_type_t report_t
|
||||
while (hid_descriptor_len){
|
||||
int valid_report_type = 0;
|
||||
hid_descriptor_item_t item;
|
||||
btstack_hid_parse_descriptor_item(&item, hid_descriptor, hid_descriptor_len);
|
||||
bool ok = btstack_hid_parse_descriptor_item(&item, hid_descriptor, hid_descriptor_len);
|
||||
if (ok == false) {
|
||||
return 0;
|
||||
}
|
||||
switch (item.item_type){
|
||||
case Global:
|
||||
switch ((GlobalItemTag)item.item_tag){
|
||||
|
@ -194,6 +194,7 @@ bool btstack_hid_parse_descriptor_item(hid_descriptor_item_t * item, const uint8
|
||||
* @param report_type
|
||||
* @param hid_descriptor_len
|
||||
* @param hid_descriptor
|
||||
* @return report size in bytes or 0 on parsing error
|
||||
*/
|
||||
int btstack_hid_get_report_size_for_id(int report_id, hid_report_type_t report_type, uint16_t hid_descriptor_len, const uint8_t * hid_descriptor);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user