-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: bluetooth: audio: add mock functions for bap broadcast assistant
With the implementation of broadcast reception start procedure we need a mockup for the bap broadcast assistant Signed-off-by: Andries Kruithof <[email protected]>
- Loading branch information
Showing
2 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
tests/bluetooth/audio/cap_commander/uut/bap_broadcast_assistant.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* Copyright (c) 2023 Nordic Semiconductor ASA | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#include "zephyr/bluetooth/audio/bap.h" | ||
|
||
static struct bt_bap_broadcast_assistant_cb *broadcast_assistant_cbs; | ||
|
||
int bt_bap_broadcast_assistant_register_cb(struct bt_bap_broadcast_assistant_cb *cb) | ||
{ | ||
broadcast_assistant_cbs = cb; | ||
|
||
return 0; | ||
} | ||
|
||
int bt_bap_broadcast_assistant_add_src(struct bt_conn *conn, | ||
const struct bt_bap_broadcast_assistant_add_src_param *param) | ||
{ | ||
/* Note that proper parameter checking is done in the caller */ | ||
zassert_not_null(conn, "conn is NULL"); | ||
zassert_not_null(param, "param is NULL"); | ||
|
||
if (broadcast_assistant_cbs->add_src != NULL) { | ||
broadcast_assistant_cbs->add_src(conn, 0); | ||
} | ||
|
||
return 0; | ||
} |