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.62k stars 6.5k forks source link

LE Audio: BASS/Scan delegator should truncate long notifications for reconnecting bonded devices #75365

Closed Thalley closed 2 months ago

Thalley commented 3 months ago

Is your enhancement proposal related to a problem? Please describe. If a BASS receive state has changed and has a length of 70 and the exchanged MTU is 65, then scan_delegator_security_changed fails to send the notification. Similarly, when a bonded device reconnects, then the MTU might only be 23 and the notification is even more likely to fail sending.

The BASS spec states

If the server supports characteristic values larger than the minimum ATT_MTU for the Unenhanced ATT bearer, then the server should support the Read Long Characteristic Values GATT sub-procedure if not already required by the Bluetooth Core Specification

This implies that we can expect clients to support the Read Long Characteristic Values procedure as well, an thus truncated receive state notifications should trigger a long read from them.

Describe the solution you'd like Truncate BASS receive state notifications to the MTU size in scan_delegator_security_changed. This can probably be done by just calling bass_notify_receive_state

Describe alternatives you've considered N/A

Additional context N/A

Thalley commented 3 months ago

Modified to bug as the behavior actually exist for most places, just not when devices are reconnecting.