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.6k stars 6.49k forks source link

Improve the description of _changed callback in BT_GATT_CCC macro in gatt.h #55373

Open hubuhubu opened 1 year ago

hubuhubu commented 1 year ago

Is your feature request related to a problem? Please describe. When multiple client connected to a GATT server the _changed callback will not called on the change of CCCD instance on every client but instead it only called when all instance of CCCD is changed to 0 or when they are all 0 and one of the client change them to 1.

Describe the solution you'd like A better documentation on the behavior of the _changed callback() for now with the current description of the callback , it gives the impression that any change in any CCCD instance would result in the callback.

Describe alternatives you've considered Or change the way the _changed callback should work to reflect any change in any client.

alwa-nordic commented 1 year ago

Do you have a concrete proposal for a new wording? The documentation is technically correct. The term 'value' in the documentation of _bt_gatt_ccc::cfg_changed refers to _bt_gatt_ccc::value. We just need to reword it to avoid confusion. I agree there is a problem with the grammar of the current wording.

https://github.com/zephyrproject-rtos/zephyr/blob/0be57d37900b303c6e7f49de7bc8e1168843c228/include/zephyr/bluetooth/gatt.h#L738-L746