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
11.01k stars 6.7k forks source link

LE Audio: TBS ensure that notifications are sent #57443

Open Thalley opened 1 year ago

Thalley commented 1 year ago

Is your enhancement proposal related to a problem? Please describe. In TBS we don't verify that all notifications are actually sent. Since this may cause issues for remote devices (and is in fact not spec compliant), we should ensure that all notifications (or at least the latest value) is sent as notifications.

Describe the solution you'd like Create a bitfield where each bit indicate that a specific characteristic value needs to be notified. Once a notification should be sent, the thread doing the change should set this bit, post a k_work item (or similar) and then just continue. The k_work item can then (in a separate thread) attempt to send the notification. If it fails, then it will simply try again later. If it succeeds, it will attempt the next notification, until all notifications are sent.

Describe alternatives you've considered N/A

Additional context N/A

kruithofa commented 10 months ago

See the implementation in for example MCS for inspiration