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.88k stars 6.63k forks source link

Bluetooth: Host: Automatically subscribe to Service Changed Indications #46695

Open hermabe opened 2 years ago

hermabe commented 2 years ago

Is your enhancement proposal related to a problem? Please describe. Core Spec Version 5.3 | Vol 3, Part G, Section 7.1 SERVICE CHANGED states:

This Characteristic Value shall be configured to be indicated using the Client Characteristic Configuration descriptor by a client. Indications caused by changes to the Service Changed Characteristic Value shall be considered lost if the client has erroneously not enabled indications in the Client Characteristic Configuration descriptor (see [Vol 3] Part F, Section 3.3.3).

It is thus required by the spec to subscribe to Service Changed Indications. This should be handled by the stack instead of requiring the application to do this.

Describe the solution you'd like After connecting to a GATT server, the host stack should do discovery and subscribe to Service Changed Indications.

Describe alternatives you've considered Leave it up to the application to subscribe to Service Changed Indications. This is the current solution and if the application does not do this, it is no longer spec-compliant.

Additional context This ties in to the general feature of GATT caching on the client side, which is not currently implemented. Related issues are the Client Supported Features characteristic (https://github.com/zephyrproject-rtos/zephyr/issues/44587), and general discovery procedure (https://github.com/zephyrproject-rtos/zephyr/issues/31306).

zephyrbot commented 9 months ago

Hi @jhedberg, @jori-nordic,

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!

hermabe commented 9 months ago

This will depend on a discovery module and caching support in the host. Until then applications will have to handle this themselves.