diff --git a/test/hid_parser/hid_parser_test.cpp b/test/hid_parser/hid_parser_test.cpp index c5d0b61e9..e35e31394 100644 --- a/test/hid_parser/hid_parser_test.cpp +++ b/test/hid_parser/hid_parser_test.cpp @@ -576,6 +576,31 @@ TEST(HID, GetReportSize){ CHECK_EQUAL(8, report_size); } +TEST(HID, UsageIteratorBootKeyboard){ + const uint8_t * hid_descriptor = hid_descriptor_keyboard_boot_mode; + uint16_t hid_descriptor_len = sizeof(hid_descriptor_keyboard_boot_mode); + btstack_hid_parser_t parser; + btstack_hid_usage_iterator_init(&parser, hid_descriptor, hid_descriptor_len, HID_REPORT_TYPE_INPUT); + while (btstack_hid_usage_iterator_has_more(&parser)){ + btstack_hid_usage_item_t item; + btstack_hid_usage_iterator_get_item(&parser, &item); + // printf("Report ID 0x%04x, bitpos %3u, usage page 0x%04x, usage 0x%04x, size %u\n", item.report_id, item.bit_pos, item.usage_page, item.usage, item.size); + } +} + +TEST(HID, UsageIteratorCombo1){ + const uint8_t * hid_descriptor = combo_descriptor_with_report_ids; + uint16_t hid_descriptor_len = sizeof(combo_descriptor_with_report_ids); + btstack_hid_parser_t parser; + btstack_hid_usage_iterator_init(&parser, hid_descriptor, hid_descriptor_len, HID_REPORT_TYPE_INPUT); + while (btstack_hid_usage_iterator_has_more(&parser)){ + btstack_hid_usage_item_t item; + btstack_hid_usage_iterator_get_item(&parser, &item); + // printf("Report ID 0x%04x, bitpos %3u, usage page 0x%04x, usage 0x%04x, size %u\n", item.report_id, item.bit_pos, item.usage_page, item.usage, item.size); + } +} + +#include "btstack_debug.h" int main (int argc, const char * argv[]){ #if 1