Bluetooth: Audio: Fix issue with registering AICS callbacks
When registering AICS callbacks via bt_vcs_client_cb_register or bt_micp_mic_ctlr_cb_register it could fail if the application did not reset the aics_cb.discover as that is set internally. This commit adds a simple check to also allow the aics_cb.discover to be the callback they expect/want it to be. Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This commit is contained in:
parent
a02e6d21bb
commit
2b0f98b4fc
2 changed files with 6 additions and 2 deletions
|
@ -456,7 +456,9 @@ int bt_micp_mic_ctlr_cb_register(struct bt_micp_mic_ctlr_cb *cb)
|
|||
struct bt_aics_cb *aics_cb = NULL;
|
||||
|
||||
if (cb != NULL) {
|
||||
CHECKIF(cb->aics_cb.discover != NULL) {
|
||||
/* Ensure that the cb->aics_cb.discover is the aics_discover_cb */
|
||||
CHECKIF(cb->aics_cb.discover != NULL &&
|
||||
cb->aics_cb.discover != aics_discover_cb) {
|
||||
BT_ERR("AICS discover callback shall not be set");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
|
|
@ -837,7 +837,9 @@ int bt_vcs_client_cb_register(struct bt_vcs_cb *cb)
|
|||
struct bt_aics_cb *aics_cb = NULL;
|
||||
|
||||
if (cb != NULL) {
|
||||
CHECKIF(cb->aics_cb.discover) {
|
||||
/* Ensure that the cb->aics_cb.discover is the aics_discover_cb */
|
||||
CHECKIF(cb->aics_cb.discover != NULL &&
|
||||
cb->aics_cb.discover != aics_discover_cb) {
|
||||
BT_ERR("AICS discover callback shall not be set");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue