Skip to content

Commit

Permalink
tests: bluetooth: audio: add mock functions for bap broadcast assistant
Browse files Browse the repository at this point in the history
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
kruithofa committed Feb 29, 2024
1 parent d0648a8 commit 008977c
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/bluetooth/audio/cap_commander/uut/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ add_library(uut STATIC
${ZEPHYR_BASE}/subsys/bluetooth/audio/cap_common.c
${ZEPHYR_BASE}/subsys/logging/log_minimal.c
${ZEPHYR_BASE}/subsys/net/buf_simple.c
bap_broadcast_assistant.c
csip.c
vcp.c
vocs.c
Expand Down
30 changes: 30 additions & 0 deletions tests/bluetooth/audio/cap_commander/uut/bap_broadcast_assistant.c
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;
}

0 comments on commit 008977c

Please sign in to comment.