Skip to content

Commit e7e7386

Browse files
Thalleyaescolar
authored andcommitted
Bluetooth: BAP: Modify unicast client callbacks to slist
Modify the BAP unicast client callback structure to be a linked list. The purpose of this is to have multiple listeners of the unicast client changes and notifications. This is needed for the CAP initiatior. Signed-off-by: Emil Gydesen <[email protected]>
1 parent 9109cfe commit e7e7386

File tree

4 files changed

+239
-130
lines changed

4 files changed

+239
-130
lines changed

doc/releases/migration-guide-4.0.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,10 @@ Bluetooth Audio
315315
is enabled and that all members are bonded, to comply with the requirements from the CSIP spec.
316316
(:github:`78877`)
317317

318+
* The callback structure provided to :c:func:`bt_bap_unicast_client_register_cb` is no longer
319+
:code:`const`, and now multiple callback structures can be registered.
320+
(:github:`78999`)
321+
318322
* The Broadcast Audio Scan Service (BASS) shall now be registered and unregistered dynamically
319323
at runtime within the scan delegator. Two new APIs, :c:func:`bt_bap_scan_delegator_register()`
320324
and :c:func:`bt_bap_scan_delegator_unregister()`, have been introduced to manage both BASS and

include/zephyr/bluetooth/audio/bap.h

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1712,6 +1712,11 @@ struct bt_bap_unicast_client_cb {
17121712
* If discovery procedure has complete both @p codec and @p ep are set to NULL.
17131713
*/
17141714
void (*discover)(struct bt_conn *conn, int err, enum bt_audio_dir dir);
1715+
1716+
/** @cond INTERNAL_HIDDEN */
1717+
/** Internally used field for list handling */
1718+
sys_snode_t _node;
1719+
/** @endcond */
17151720
};
17161721

17171722
/**
@@ -1722,9 +1727,11 @@ struct bt_bap_unicast_client_cb {
17221727
*
17231728
* @param cb Unicast client callback structure.
17241729
*
1725-
* @return 0 in case of success or negative value in case of error.
1730+
* @retval 0 Success
1731+
* @retval -EINVAL @p cb is NULL.
1732+
* @retval -EEXIST @p cb is already registered.
17261733
*/
1727-
int bt_bap_unicast_client_register_cb(const struct bt_bap_unicast_client_cb *cb);
1734+
int bt_bap_unicast_client_register_cb(struct bt_bap_unicast_client_cb *cb);
17281735

17291736
/**
17301737
* @brief Discover remote capabilities and endpoints

0 commit comments

Comments
 (0)