zephyrproject-rtos / zephyr

Primary Git Repository for the Zephyr Project. Zephyr is a new generation, scalable, optimized, secure RTOS for multiple hardware architectures.
https://docs.zephyrproject.org
Apache License 2.0
10.51k stars 6.44k forks source link

Bluetooth: Host: Automatically write the Client Supported Features Characteristic #44587

Open hermabe opened 2 years ago

hermabe commented 2 years ago

Is your enhancement proposal related to a problem? Please describe. To be able to use certain features like Robust Caching or Multiple Handle Value Notifications, the GATT client must write to the Client Supported Features Characteristic. The host should automatically do this so that the application only needs to enable the relevant Kconfigs to use the features.

Describe the solution you'd like After connection to a GATT server, the Client automatically discovers and writes the relevant bits to the Client Supported Features Characteristic. The application should be able to enable/disable this functionality using a Kconfig. I am thinking something along the lines of:

config BT_GATT_AUTO_CSF
    bool "Automatically write to the Client Supported Feature Characteristic"
    depends on BT_EATT || BT_GATT_CACHING || BT_GATT_NOTIFY_MULTIPLE
    default BT_EATT || BT_GATT_CACHING || BT_GATT_NOTIFY_MULTIPLE

Describe alternatives you've considered Make the feature bit definitions from gatt.c public and depend on the application developer to do the correct initialization to enable these features.

Additional context N/A

zephyrbot commented 7 months ago

Hi @jori-nordic, @jhedberg,

This issue, marked as an Enhancement, was opened a while ago and did not get any traction. It was just assigned to you based on the labels. If you don't consider yourself the right person to address this issue, please re-assing it to the right person.

Please take a moment to review if the issue is still relevant to the project. If it is, please provide feedback and direction on how to move forward. If it is not, has already been addressed, is a duplicate, or is no longer relevant, please close it with a short comment explaining the reason.

@hermabe you are also encouraged to help moving this issue forward by providing additional information and confirming this request/issue is still relevant to you.

Thanks!

jori-nordic commented 7 months ago

Make the feature bit definitions from gatt.c public and depend on the application developer to do the correct initialization to enable these features.

Since the host does no automatic discovery, I would prefer this to be the solution to this issue Note that a discovery module would be very helpful. It is a big feature though, and I'd rather we clean up the GATT module before embarking on this.

hermabe commented 7 months ago

Note that a discovery module would be very helpful. It is a big feature though, and I'd rather we clean up the GATT module before embarking on this.

Yeah, this is connected to some other enhancement issues relating to discovery, service changed and caching.