File tree Expand file tree Collapse file tree 2 files changed +26
-4
lines changed
include/zephyr/bluetooth/audio Expand file tree Collapse file tree 2 files changed +26
-4
lines changed Original file line number Diff line number Diff line change @@ -1967,17 +1967,24 @@ struct bt_bap_unicast_client_cb {
19671967/**
19681968 * @brief Register unicast client callbacks.
19691969 *
1970- * Only one callback structure can be registered, and attempting to
1971- * registering more than one will result in an error.
1972- *
1973- * @param cb Unicast client callback structure.
1970+ * @param cb Unicast client callback structure to register.
19741971 *
19751972 * @retval 0 Success
19761973 * @retval -EINVAL @p cb is NULL.
19771974 * @retval -EEXIST @p cb is already registered.
19781975 */
19791976int bt_bap_unicast_client_register_cb (struct bt_bap_unicast_client_cb * cb );
19801977
1978+ /**
1979+ * @brief Unregister unicast client callbacks.
1980+ *
1981+ * @param cb Unicast client callback structure to unregister.
1982+ *
1983+ * @retval 0 Success
1984+ * @retval -EINVAL @p cb is NULL or @p cb was not registered
1985+ */
1986+ int bt_bap_unicast_client_unregister_cb (struct bt_bap_unicast_client_cb * cb );
1987+
19811988/**
19821989 * @brief Discover remote capabilities and endpoints
19831990 *
Original file line number Diff line number Diff line change @@ -4684,3 +4684,18 @@ int bt_bap_unicast_client_register_cb(struct bt_bap_unicast_client_cb *cb)
46844684
46854685 return 0 ;
46864686}
4687+
4688+ int bt_bap_unicast_client_unregister_cb (struct bt_bap_unicast_client_cb * cb )
4689+ {
4690+ if (cb == NULL ) {
4691+ LOG_DBG ("cb was NULL" );
4692+ return - EINVAL ;
4693+ }
4694+
4695+ if (!sys_slist_find_and_remove (& unicast_client_cbs , & cb -> _node )) {
4696+ LOG_DBG ("cb was not registered" );
4697+ return - EALREADY ;
4698+ }
4699+
4700+ return 0 ;
4701+ }
You can’t perform that action at this time.
0 commit comments