Lines Matching refs:parser
453 void btstack_hid_parser_init(btstack_hid_parser_t * parser, const uint8_t * hid_descriptor, uint16_… in btstack_hid_parser_init() argument
454 …btstack_hid_usage_iterator_init(&parser->usage_iterator, hid_descriptor, hid_descriptor_len, hid_r… in btstack_hid_parser_init()
455 parser->report = hid_report; in btstack_hid_parser_init()
456 parser->report_len = hid_report_len; in btstack_hid_parser_init()
457 parser->have_report_usage_ready = false; in btstack_hid_parser_init()
464 bool btstack_hid_parser_has_more(btstack_hid_parser_t * parser){ in btstack_hid_parser_has_more() argument
465 …while ((parser->have_report_usage_ready == false) && btstack_hid_usage_iterator_has_more(&parser->… in btstack_hid_parser_has_more()
466 … btstack_hid_usage_iterator_get_item(&parser->usage_iterator, &parser->descriptor_usage_item); in btstack_hid_parser_has_more()
468 if (parser->descriptor_usage_item.report_id != HID_REPORT_ID_UNDEFINED){ in btstack_hid_parser_has_more()
469 if (parser->descriptor_usage_item.report_id != parser->report[0]){ in btstack_hid_parser_has_more()
473 parser->have_report_usage_ready = true; in btstack_hid_parser_has_more()
475 return parser->have_report_usage_ready; in btstack_hid_parser_has_more()
486 void btstack_hid_parser_get_field(btstack_hid_parser_t * parser, uint16_t * usage_page, uint16_t * … in btstack_hid_parser_get_field() argument
489 uint16_t bit_pos = parser->descriptor_usage_item.bit_pos; in btstack_hid_parser_get_field()
490 uint16_t size = parser->descriptor_usage_item.size; in btstack_hid_parser_get_field()
491 *usage_page = parser->descriptor_usage_item.usage_page; in btstack_hid_parser_get_field()
492 *usage = parser->descriptor_usage_item.usage; in btstack_hid_parser_get_field()
495 if (parser->descriptor_usage_item.report_id != HID_REPORT_ID_UNDEFINED){ in btstack_hid_parser_get_field()
500 bool is_variable = (parser->descriptor_usage_item.descriptor_item.item_value & 2) != 0; in btstack_hid_parser_get_field()
501 bool is_signed = parser->descriptor_usage_item.global_logical_minimum < 0; in btstack_hid_parser_get_field()
502 int pos_start = btstack_min( bit_pos >> 3, parser->report_len); in btstack_hid_parser_get_field()
503 int pos_end = btstack_min( (bit_pos + size - 1u) >> 3u, parser->report_len); in btstack_hid_parser_get_field()
509 multi_byte_value |= parser->report[pos_start+i] << (i*8); in btstack_hid_parser_get_field()
524 parser->have_report_usage_ready = false; in btstack_hid_parser_get_field()