hid_host: filter sdp record atrributes

This commit is contained in:
Matthias Ringwald 2024-01-26 18:28:39 +01:00
parent db6cafabbb
commit d1b426c456

View File

@ -550,9 +550,23 @@ static void hid_host_handle_sdp_client_query_result(uint8_t packet_type, uint16_
attribute_offset = sdp_event_query_attribute_byte_get_data_offset(packet);
attribute_data = sdp_event_query_attribute_byte_get_data(packet);
// process BLUETOOTH_ATTRIBUTE_HID_DESCRIPTOR_LIST with state machine
if (attribute_id == BLUETOOTH_ATTRIBUTE_HID_DESCRIPTOR_LIST){
hid_host_handle_sdp_hid_descriptor_list(connection, attribute_offset, attribute_data);
// filter attributes
bool process_data = false;
switch (attribute_id){
case BLUETOOTH_ATTRIBUTE_PROTOCOL_DESCRIPTOR_LIST:
case BLUETOOTH_ATTRIBUTE_ADDITIONAL_PROTOCOL_DESCRIPTOR_LISTS:
case BLUETOOTH_ATTRIBUTE_HIDSSR_HOST_MAX_LATENCY:
case BLUETOOTH_ATTRIBUTE_HIDSSR_HOST_MIN_TIMEOUT:
process_data = true;
break;
case BLUETOOTH_ATTRIBUTE_HID_DESCRIPTOR_LIST:
// directly process BLUETOOTH_ATTRIBUTE_HID_DESCRIPTOR_LIST with state machine
hid_host_handle_sdp_hid_descriptor_list(connection, attribute_offset, attribute_data);
break;
default:
break;
}
if (process_data == false){
break;
}