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 @@ -1982,17 +1982,24 @@ struct bt_bap_unicast_client_cb {
1982
1982
/**
1983
1983
* @brief Register unicast client callbacks.
1984
1984
*
1985
- * Only one callback structure can be registered, and attempting to
1986
- * registering more than one will result in an error.
1987
- *
1988
- * @param cb Unicast client callback structure.
1985
+ * @param cb Unicast client callback structure to register.
1989
1986
*
1990
1987
* @retval 0 Success
1991
1988
* @retval -EINVAL @p cb is NULL.
1992
1989
* @retval -EEXIST @p cb is already registered.
1993
1990
*/
1994
1991
int bt_bap_unicast_client_register_cb (struct bt_bap_unicast_client_cb * cb );
1995
1992
1993
+ /**
1994
+ * @brief Unregister unicast client callbacks.
1995
+ *
1996
+ * @param cb Unicast client callback structure to unregister.
1997
+ *
1998
+ * @retval 0 Success
1999
+ * @retval -EINVAL @p cb is NULL or @p cb was not registered
2000
+ */
2001
+ int bt_bap_unicast_client_unregister_cb (struct bt_bap_unicast_client_cb * cb );
2002
+
1996
2003
/**
1997
2004
* @brief Discover remote capabilities and endpoints
1998
2005
*
Original file line number Diff line number Diff line change @@ -4719,3 +4719,18 @@ int bt_bap_unicast_client_register_cb(struct bt_bap_unicast_client_cb *cb)
4719
4719
4720
4720
return 0 ;
4721
4721
}
4722
+
4723
+ int bt_bap_unicast_client_unregister_cb (struct bt_bap_unicast_client_cb * cb )
4724
+ {
4725
+ if (cb == NULL ) {
4726
+ LOG_DBG ("cb was NULL" );
4727
+ return - EINVAL ;
4728
+ }
4729
+
4730
+ if (!sys_slist_find_and_remove (& unicast_client_cbs , & cb -> _node )) {
4731
+ LOG_DBG ("cb was not registered" );
4732
+ return - EALREADY ;
4733
+ }
4734
+
4735
+ return 0 ;
4736
+ }
You can’t perform that action at this time.
0 commit comments