hid_host: storage for HID Descriptors is now optional

This commit is contained in:
Matthias Ringwald 2025-01-30 12:29:05 +01:00
parent 640945cecc
commit a1d703afb2
3 changed files with 13 additions and 3 deletions

View File

@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
### Added
- GAP: simulate HCI_EVENT_REMOTE_NAME_REQUEST_COMPLETE if HCI Remote Name Request fails
- AVRCP Controller: Added send generic PASS THROUGH command
- HID Host: storage for HID Descriptors is now optional
### Fixed
- GAP: store link key for standard/non-SSP pairing
### Changed

View File

@ -559,8 +559,11 @@ static void hid_host_handle_sdp_client_query_result(uint8_t packet_type, uint16_
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);
// directly process BLUETOOTH_ATTRIBUTE_HID_DESCRIPTOR_LIST with state machine if hid_descriptor_storage is available
if (hid_host_descriptor_storage != NULL){
hid_host_handle_sdp_hid_descriptor_list(connection, attribute_offset, attribute_data);
break;
}
break;
default:
break;
@ -1162,6 +1165,7 @@ static void hid_host_packet_handler(uint8_t packet_type, uint16_t channel, uint8
void hid_host_init(uint8_t * hid_descriptor_storage, uint16_t hid_descriptor_storage_len){
btstack_assert((hid_descriptor_storage_len == 0) || (hid_descriptor_storage != NULL));
hid_host_descriptor_storage = hid_descriptor_storage;
hid_host_descriptor_storage_len = hid_descriptor_storage_len;

View File

@ -132,7 +132,12 @@ typedef struct {
/* API_START */
/**
* @brief Set up HID Host
* @brief Set up HID Host and provide storage for HID Descriptors
* If storage for HID Descriptors is provided, the HID Host will fetch and store the HID Descriptors
* for each connection and inform the application via HID_SUBEVENT_DESCRIPTOR_AVAILABLE event.
* The app can then access the HID descriptor for a particular connection with
* hid_descriptor_storage_get_descriptor_data and hid_descriptor_storage_get_descriptor_len.
* @note if hid_descriptor_storage is NULL, the HID Host will not store the HID Descriptor
* @param hid_descriptor_storage
* @param hid_descriptor_storage_len
*/