Bluetooth: VOCS: Client: Use CCC auto discover
#81,132 opened on Nov 8, 2024
Repository metrics
- Stars
- (15,249 stars)
- PR merge metrics
- (Avg merge 4d 21h) (1,000 merged PRs in 30d)
Description
Is your enhancement proposal related to a problem? Please describe. The VOCS client subscribes to the VOCS state, location and description, but it assumes that the CCC is the next characteristic by hard-coding the handle offset:
/*
* TODO: Don't assume that CCC is at handle + 2;
* do proper discovery;
*/
sub_params->ccc_handle = attr->handle + 2;
Describe the solution you'd like
The VOCS client should perform a proper discovery of the CCC characteristic and subscribe to it, even if it is not at handle + 2. For this the CONFIG_BT_GATT_AUTO_DISCOVER_CCC feature can be used, which is already used in most parts of LE Audio.
Ideally the use of CONFIG_BT_GATT_AUTO_DISCOVER_CCC should re-use the initial discovery parameter struct, so as not to increase memory usage.
Describe alternatives you've considered N/A
Additional context N/A