Bluetooth: CAP: Implement bt_cap_initiator_unregister_cb
Implement function to unregisterd the CAP initiator callbacks. Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This commit is contained in:
parent
68adc77cbd
commit
92002b2dff
2 changed files with 27 additions and 0 deletions
|
@ -296,6 +296,16 @@ struct bt_cap_unicast_audio_stop_param {
|
||||||
*/
|
*/
|
||||||
int bt_cap_initiator_register_cb(const struct bt_cap_initiator_cb *cb);
|
int bt_cap_initiator_register_cb(const struct bt_cap_initiator_cb *cb);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Unregister Common Audio Profile Initiator callbacks
|
||||||
|
*
|
||||||
|
* @param cb The callback structure that was previously registered.
|
||||||
|
*
|
||||||
|
* @retval 0 Success
|
||||||
|
* @retval -EINVAL @p cb is NULL or @p cb was not registered
|
||||||
|
*/
|
||||||
|
int bt_cap_initiator_unregister_cb(const struct bt_cap_initiator_cb *cb);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Setup and start unicast audio streams for a set of devices.
|
* @brief Setup and start unicast audio streams for a set of devices.
|
||||||
*
|
*
|
||||||
|
|
|
@ -53,6 +53,23 @@ int bt_cap_initiator_register_cb(const struct bt_cap_initiator_cb *cb)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int bt_cap_initiator_unregister_cb(const struct bt_cap_initiator_cb *cb)
|
||||||
|
{
|
||||||
|
CHECKIF(cb == NULL) {
|
||||||
|
LOG_DBG("cb is NULL");
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
CHECKIF(cap_cb != cb) {
|
||||||
|
LOG_DBG("cb is not registered");
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
cap_cb = NULL;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
struct valid_metadata_param {
|
struct valid_metadata_param {
|
||||||
bool stream_context_found;
|
bool stream_context_found;
|
||||||
bool valid;
|
bool valid;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue