Bluetooth: CAP: Remove unicast group param from unicast_audio_start
Since we can always lookup the group from the streams, the group parameter had no purpose. Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This commit is contained in:
parent
840db7858e
commit
f35e9871d5
8 changed files with 65 additions and 106 deletions
|
@ -76,8 +76,6 @@ struct bt_cap_initiator_cb {
|
|||
/**
|
||||
* @brief Callback for bt_cap_initiator_unicast_audio_start().
|
||||
*
|
||||
* @param unicast_group The unicast group pointer supplied to
|
||||
* bt_cap_initiator_unicast_audio_start().
|
||||
* @param err 0 if success, BT_GATT_ERR() with a
|
||||
* specific ATT (BT_ATT_ERR_*) error code or -ECANCELED if cancelled
|
||||
* by bt_cap_initiator_unicast_audio_cancel().
|
||||
|
@ -85,8 +83,7 @@ struct bt_cap_initiator_cb {
|
|||
* occurred. NULL if @p err is 0 or if cancelled by
|
||||
* bt_cap_initiator_unicast_audio_cancel()
|
||||
*/
|
||||
void (*unicast_start_complete)(struct bt_bap_unicast_group *unicast_group,
|
||||
int err, struct bt_conn *conn);
|
||||
void (*unicast_start_complete)(int err, struct bt_conn *conn);
|
||||
|
||||
/**
|
||||
* @brief Callback for bt_cap_initiator_unicast_audio_update().
|
||||
|
@ -103,14 +100,6 @@ struct bt_cap_initiator_cb {
|
|||
/**
|
||||
* @brief Callback for bt_cap_initiator_unicast_audio_stop().
|
||||
*
|
||||
* If @p err is 0, then @p unicast_group has been deleted and can no
|
||||
* longer be used.
|
||||
*
|
||||
* If @p err is not 0 and @p conn is NULL, then the deletion of the
|
||||
* @p unicast_group failed with @p err as the error.
|
||||
*
|
||||
* @param unicast_group The unicast group pointer supplied to
|
||||
* bt_cap_initiator_unicast_audio_stop().
|
||||
* @param err 0 if success, BT_GATT_ERR() with a
|
||||
* specific ATT (BT_ATT_ERR_*) error code or -ECANCELED if cancelled
|
||||
* by bt_cap_initiator_unicast_audio_cancel().
|
||||
|
@ -118,8 +107,7 @@ struct bt_cap_initiator_cb {
|
|||
* occurred. NULL if @p err is 0 or if cancelled by
|
||||
* bt_cap_initiator_unicast_audio_cancel()
|
||||
*/
|
||||
void (*unicast_stop_complete)(struct bt_bap_unicast_group *unicast_group,
|
||||
int err, struct bt_conn *conn);
|
||||
void (*unicast_stop_complete)(int err, struct bt_conn *conn);
|
||||
#endif /* CONFIG_BT_BAP_UNICAST_CLIENT */
|
||||
};
|
||||
|
||||
|
@ -206,6 +194,7 @@ int bt_cap_stream_send(struct bt_cap_stream *stream, struct net_buf *buf, uint16
|
|||
*/
|
||||
int bt_cap_stream_get_tx_sync(struct bt_cap_stream *stream, struct bt_iso_tx_info *info);
|
||||
|
||||
/** Stream specific parameters for the bt_cap_initiator_unicast_audio_start() function */
|
||||
struct bt_cap_unicast_audio_start_stream_param {
|
||||
/** Coordinated or ad-hoc set member. */
|
||||
union bt_cap_set_member member;
|
||||
|
@ -226,6 +215,7 @@ struct bt_cap_unicast_audio_start_stream_param {
|
|||
struct bt_audio_codec_cfg *codec_cfg;
|
||||
};
|
||||
|
||||
/** Parameters for the bt_cap_initiator_unicast_audio_start() function */
|
||||
struct bt_cap_unicast_audio_start_param {
|
||||
/** The type of the set. */
|
||||
enum bt_cap_set_type type;
|
||||
|
@ -272,13 +262,11 @@ int bt_cap_initiator_register_cb(const struct bt_cap_initiator_cb *cb);
|
|||
* @kconfig{CONFIG_BT_BAP_UNICAST_CLIENT} must be enabled for this function
|
||||
* to be enabled.
|
||||
*
|
||||
* @param[in] param Parameters to start the audio streams.
|
||||
* @param[out] unicast_group Pointer to the unicast group.
|
||||
* @param param Parameters to start the audio streams.
|
||||
*
|
||||
* @return 0 on success or negative error value on failure.
|
||||
*/
|
||||
int bt_cap_initiator_unicast_audio_start(const struct bt_cap_unicast_audio_start_param *param,
|
||||
struct bt_bap_unicast_group *unicast_group);
|
||||
int bt_cap_initiator_unicast_audio_start(const struct bt_cap_unicast_audio_start_param *param);
|
||||
|
||||
/**
|
||||
* @brief Update unicast audio streams.
|
||||
|
|
|
@ -119,8 +119,7 @@ static void cap_discovery_complete_cb(struct bt_conn *conn, int err,
|
|||
k_sem_give(&sem_cas_discovery);
|
||||
}
|
||||
|
||||
static void unicast_start_complete_cb(struct bt_bap_unicast_group *unicast_group,
|
||||
int err, struct bt_conn *conn)
|
||||
static void unicast_start_complete_cb(int err, struct bt_conn *conn)
|
||||
{
|
||||
if (err != 0) {
|
||||
printk("Failed to start (failing conn %p): %d", conn, err);
|
||||
|
@ -138,8 +137,7 @@ static void unicast_update_complete_cb(int err, struct bt_conn *conn)
|
|||
}
|
||||
}
|
||||
|
||||
static void unicast_stop_complete_cb(struct bt_bap_unicast_group *unicast_group, int err,
|
||||
struct bt_conn *conn)
|
||||
static void unicast_stop_complete_cb(int err, struct bt_conn *conn)
|
||||
{
|
||||
if (err != 0) {
|
||||
printk("Failed to stop (failing conn %p): %d", conn, err);
|
||||
|
@ -330,7 +328,7 @@ static int unicast_group_create(struct bt_bap_unicast_group **out_unicast_group)
|
|||
return err;
|
||||
}
|
||||
|
||||
static int unicast_audio_start(struct bt_conn *conn, struct bt_bap_unicast_group *unicast_group)
|
||||
static int unicast_audio_start(struct bt_conn *conn)
|
||||
{
|
||||
int err = 0;
|
||||
struct bt_cap_unicast_audio_start_stream_param stream_param;
|
||||
|
@ -345,7 +343,7 @@ static int unicast_audio_start(struct bt_conn *conn, struct bt_bap_unicast_group
|
|||
stream_param.ep = unicast_sink_eps[0];
|
||||
stream_param.codec_cfg = &unicast_preset_48_2_1.codec_cfg;
|
||||
|
||||
err = bt_cap_initiator_unicast_audio_start(¶m, unicast_group);
|
||||
err = bt_cap_initiator_unicast_audio_start(¶m);
|
||||
if (err != 0) {
|
||||
printk("Failed to start unicast audio: %d\n", err);
|
||||
return err;
|
||||
|
@ -457,7 +455,7 @@ int cap_initiator_setup(struct bt_conn *conn)
|
|||
return err;
|
||||
}
|
||||
|
||||
err = unicast_audio_start(conn, unicast_group);
|
||||
err = unicast_audio_start(conn);
|
||||
if (err != 0) {
|
||||
return err;
|
||||
}
|
||||
|
|
|
@ -332,9 +332,10 @@ int bt_cap_initiator_unicast_discover(struct bt_conn *conn)
|
|||
return bt_cap_common_discover(conn, bt_cap_initiator_discover_complete);
|
||||
}
|
||||
|
||||
static bool valid_unicast_audio_start_param(const struct bt_cap_unicast_audio_start_param *param,
|
||||
struct bt_bap_unicast_group *unicast_group)
|
||||
static bool valid_unicast_audio_start_param(const struct bt_cap_unicast_audio_start_param *param)
|
||||
{
|
||||
struct bt_bap_unicast_group *unicast_group = NULL;
|
||||
|
||||
CHECKIF(param == NULL) {
|
||||
LOG_DBG("param is NULL");
|
||||
return false;
|
||||
|
@ -410,10 +411,16 @@ static bool valid_unicast_audio_start_param(const struct bt_cap_unicast_audio_st
|
|||
return false;
|
||||
}
|
||||
|
||||
/* Use the group of the first stream for comparison */
|
||||
if (unicast_group == NULL) {
|
||||
unicast_group = bap_stream->group;
|
||||
} else {
|
||||
CHECKIF(bap_stream->group != unicast_group) {
|
||||
LOG_DBG("param->streams[%zu] is not in this group %p", i, unicast_group);
|
||||
LOG_DBG("param->streams[%zu] is not in this group %p", i,
|
||||
unicast_group);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
for (size_t j = 0U; j < i; j++) {
|
||||
if (param->stream_params[j].stream == cap_stream) {
|
||||
|
@ -433,12 +440,10 @@ static bool valid_unicast_audio_start_param(const struct bt_cap_unicast_audio_st
|
|||
static void cap_initiator_unicast_audio_proc_complete(void)
|
||||
{
|
||||
struct bt_cap_common_proc *active_proc = bt_cap_common_get_active_proc();
|
||||
struct bt_bap_unicast_group *unicast_group;
|
||||
enum bt_cap_common_proc_type proc_type;
|
||||
struct bt_conn *failed_conn;
|
||||
int err;
|
||||
|
||||
unicast_group = active_proc->unicast_group;
|
||||
failed_conn = active_proc->failed_conn;
|
||||
err = active_proc->err;
|
||||
proc_type = active_proc->proc_type;
|
||||
|
@ -451,7 +456,7 @@ static void cap_initiator_unicast_audio_proc_complete(void)
|
|||
switch (proc_type) {
|
||||
case BT_CAP_COMMON_PROC_TYPE_START:
|
||||
if (cap_cb->unicast_start_complete != NULL) {
|
||||
cap_cb->unicast_start_complete(unicast_group, err, failed_conn);
|
||||
cap_cb->unicast_start_complete(err, failed_conn);
|
||||
}
|
||||
break;
|
||||
case BT_CAP_COMMON_PROC_TYPE_UPDATE:
|
||||
|
@ -461,7 +466,7 @@ static void cap_initiator_unicast_audio_proc_complete(void)
|
|||
break;
|
||||
case BT_CAP_COMMON_PROC_TYPE_STOP:
|
||||
if (cap_cb->unicast_stop_complete != NULL) {
|
||||
cap_cb->unicast_stop_complete(unicast_group, err, failed_conn);
|
||||
cap_cb->unicast_stop_complete(err, failed_conn);
|
||||
}
|
||||
break;
|
||||
case BT_CAP_COMMON_PROC_TYPE_NONE:
|
||||
|
@ -533,28 +538,18 @@ static int cap_initiator_unicast_audio_configure(
|
|||
return err;
|
||||
}
|
||||
|
||||
int bt_cap_initiator_unicast_audio_start(const struct bt_cap_unicast_audio_start_param *param,
|
||||
struct bt_bap_unicast_group *unicast_group)
|
||||
int bt_cap_initiator_unicast_audio_start(const struct bt_cap_unicast_audio_start_param *param)
|
||||
{
|
||||
struct bt_cap_common_proc *active_proc = bt_cap_common_get_active_proc();
|
||||
|
||||
if (bt_cap_common_proc_is_active()) {
|
||||
LOG_DBG("A CAP procedure is already in progress");
|
||||
|
||||
return -EBUSY;
|
||||
}
|
||||
|
||||
CHECKIF(unicast_group == NULL) {
|
||||
LOG_DBG("unicast_group is NULL");
|
||||
if (!valid_unicast_audio_start_param(param)) {
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (!valid_unicast_audio_start_param(param, unicast_group)) {
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
active_proc->unicast_group = unicast_group;
|
||||
|
||||
return cap_initiator_unicast_audio_configure(param);
|
||||
}
|
||||
|
||||
|
@ -1119,7 +1114,6 @@ int bt_cap_initiator_unicast_audio_stop(struct bt_bap_unicast_group *unicast_gro
|
|||
}
|
||||
|
||||
bt_cap_common_start_proc(BT_CAP_COMMON_PROC_TYPE_STOP, stream_cnt);
|
||||
active_proc->unicast_group = unicast_group;
|
||||
|
||||
bt_cap_common_set_subproc(BT_CAP_COMMON_SUBPROC_TYPE_RELEASE);
|
||||
|
||||
|
|
|
@ -111,7 +111,6 @@ struct bt_cap_common_proc {
|
|||
struct bt_conn *failed_conn;
|
||||
struct bt_cap_common_proc_param proc_param;
|
||||
#if defined(CONFIG_BT_CAP_INITIATOR_UNICAST)
|
||||
struct bt_bap_unicast_group *unicast_group;
|
||||
enum bt_cap_common_subproc_type subproc_type;
|
||||
#endif /* CONFIG_BT_CAP_INITIATOR_UNICAST */
|
||||
};
|
||||
|
|
|
@ -36,8 +36,7 @@ static void cap_discover_cb(struct bt_conn *conn, int err,
|
|||
csis_inst == NULL ? "" : " with CSIS");
|
||||
}
|
||||
|
||||
static void cap_unicast_start_complete_cb(struct bt_bap_unicast_group *unicast_group,
|
||||
int err, struct bt_conn *conn)
|
||||
static void cap_unicast_start_complete_cb(int err, struct bt_conn *conn)
|
||||
{
|
||||
if (err == -ECANCELED) {
|
||||
shell_print(ctx_shell, "Unicast start was cancelled for conn %p", conn);
|
||||
|
@ -60,33 +59,25 @@ static void unicast_update_complete_cb(int err, struct bt_conn *conn)
|
|||
}
|
||||
}
|
||||
|
||||
static void unicast_stop_complete_cb(struct bt_bap_unicast_group *unicast_group, int err,
|
||||
struct bt_conn *conn)
|
||||
static void unicast_stop_complete_cb(int err, struct bt_conn *conn)
|
||||
{
|
||||
if (default_unicast_group != unicast_group) {
|
||||
/* ignore */
|
||||
return;
|
||||
}
|
||||
|
||||
if (err == -ECANCELED) {
|
||||
shell_print(ctx_shell, "Unicast stop was cancelled for conn %p", conn);
|
||||
} else if (err != 0) {
|
||||
shell_error(ctx_shell,
|
||||
"Unicast stop failed for group %p and conn %p (%d)",
|
||||
unicast_group, conn, err);
|
||||
shell_error(ctx_shell, "Unicast stop failed for conn %p (%d)", conn, err);
|
||||
} else {
|
||||
shell_print(ctx_shell,
|
||||
"Unicast stopped for group %p completed",
|
||||
default_unicast_group);
|
||||
shell_print(ctx_shell, "Unicast stopped completed");
|
||||
|
||||
err = bt_bap_unicast_group_delete(unicast_group);
|
||||
if (default_unicast_group != NULL) {
|
||||
err = bt_bap_unicast_group_delete(default_unicast_group);
|
||||
if (err != 0) {
|
||||
shell_error(ctx_shell, "Failed to delete unicast group %p: %d",
|
||||
unicast_group, err);
|
||||
default_unicast_group, err);
|
||||
} else {
|
||||
default_unicast_group = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static struct bt_cap_initiator_cb cbs = {
|
||||
|
@ -320,7 +311,7 @@ static int cmd_cap_initiator_unicast_start(const struct shell *sh, size_t argc,
|
|||
|
||||
shell_print(sh, "Starting %zu streams", start_param.count);
|
||||
|
||||
err = bt_cap_initiator_unicast_audio_start(&start_param, default_unicast_group);
|
||||
err = bt_cap_initiator_unicast_audio_start(&start_param);
|
||||
if (err != 0) {
|
||||
shell_print(sh, "Failed to start unicast audio: %d", err);
|
||||
|
||||
|
@ -625,7 +616,7 @@ static int cap_ac_unicast_start(const struct bap_unicast_ac_param *param,
|
|||
start_param.count = stream_cnt;
|
||||
start_param.type = BT_CAP_SET_TYPE_AD_HOC;
|
||||
|
||||
return bt_cap_initiator_unicast_audio_start(&start_param, default_unicast_group);
|
||||
return bt_cap_initiator_unicast_audio_start(&start_param);
|
||||
}
|
||||
|
||||
int cap_ac_unicast(const struct shell *sh, size_t argc, char **argv,
|
||||
|
|
|
@ -20,6 +20,8 @@ LOG_MODULE_REGISTER(LOG_MODULE_NAME, CONFIG_BTTESTER_LOG_LEVEL);
|
|||
#include "btp_bap_unicast.h"
|
||||
#include "btp_bap_broadcast.h"
|
||||
|
||||
static struct btp_bap_unicast_group *u_group;
|
||||
|
||||
extern struct bt_csip_set_coordinator_set_member *btp_csip_set_members[CONFIG_BT_MAX_CONN];
|
||||
|
||||
static struct bt_bap_stream *stream_unicast_to_bap(struct btp_bap_unicast_stream *stream)
|
||||
|
@ -95,20 +97,19 @@ static void btp_send_cap_unicast_stop_completed_ev(uint8_t cig_id, uint8_t statu
|
|||
tester_event(BTP_SERVICE_ID_CAP, BTP_CAP_EV_UNICAST_STOP_COMPLETED, &ev, sizeof(ev));
|
||||
}
|
||||
|
||||
static void unicast_start_complete_cb(struct bt_bap_unicast_group *group,
|
||||
int err, struct bt_conn *conn)
|
||||
static void unicast_start_complete_cb(int err, struct bt_conn *conn)
|
||||
{
|
||||
LOG_DBG("");
|
||||
|
||||
if (err != 0) {
|
||||
LOG_DBG("Failed to unicast-start, err %d", err);
|
||||
btp_send_cap_unicast_start_completed_ev(group->index,
|
||||
btp_send_cap_unicast_start_completed_ev(u_group->cig->index,
|
||||
BTP_CAP_UNICAST_START_STATUS_FAILED);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
btp_send_cap_unicast_start_completed_ev(group->index,
|
||||
btp_send_cap_unicast_start_completed_ev(u_group->cig->index,
|
||||
BTP_CAP_UNICAST_START_STATUS_SUCCESS);
|
||||
}
|
||||
|
||||
|
@ -121,20 +122,19 @@ static void unicast_update_complete_cb(int err, struct bt_conn *conn)
|
|||
}
|
||||
}
|
||||
|
||||
static void unicast_stop_complete_cb(struct bt_bap_unicast_group *group, int err,
|
||||
struct bt_conn *conn)
|
||||
static void unicast_stop_complete_cb(int err, struct bt_conn *conn)
|
||||
{
|
||||
LOG_DBG("");
|
||||
|
||||
if (err != 0) {
|
||||
LOG_DBG("Failed to unicast-stop, err %d", err);
|
||||
btp_send_cap_unicast_stop_completed_ev(group->index,
|
||||
btp_send_cap_unicast_stop_completed_ev(u_group->cig->index,
|
||||
BTP_CAP_UNICAST_START_STATUS_FAILED);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
btp_send_cap_unicast_stop_completed_ev(group->index,
|
||||
btp_send_cap_unicast_stop_completed_ev(u_group->cig->index,
|
||||
BTP_CAP_UNICAST_START_STATUS_SUCCESS);
|
||||
}
|
||||
|
||||
|
@ -282,7 +282,6 @@ static uint8_t btp_cap_unicast_audio_start(const void *cmd, uint16_t cmd_len,
|
|||
{
|
||||
int err;
|
||||
size_t stream_count = 0;
|
||||
struct btp_bap_unicast_group *u_group;
|
||||
const struct btp_cap_unicast_audio_start_cmd *cp = cmd;
|
||||
struct bt_cap_unicast_audio_start_param start_param;
|
||||
struct bt_cap_unicast_audio_start_stream_param stream_params[
|
||||
|
@ -326,7 +325,7 @@ static uint8_t btp_cap_unicast_audio_start(const void *cmd, uint16_t cmd_len,
|
|||
start_param.count = stream_count;
|
||||
start_param.stream_params = stream_params;
|
||||
|
||||
err = bt_cap_initiator_unicast_audio_start(&start_param, u_group->cig);
|
||||
err = bt_cap_initiator_unicast_audio_start(&start_param);
|
||||
if (err != 0) {
|
||||
LOG_ERR("Failed to start unicast audio: %d", err);
|
||||
|
||||
|
|
|
@ -183,8 +183,7 @@ static void cap_discovery_complete_cb(struct bt_conn *conn, int err,
|
|||
SET_FLAG(flag_discovered);
|
||||
}
|
||||
|
||||
static void unicast_start_complete_cb(struct bt_bap_unicast_group *unicast_group, int err,
|
||||
struct bt_conn *conn)
|
||||
static void unicast_start_complete_cb(int err, struct bt_conn *conn)
|
||||
{
|
||||
if (err == -ECANCELED) {
|
||||
SET_FLAG(flag_start_timeout);
|
||||
|
@ -206,8 +205,7 @@ static void unicast_update_complete_cb(int err, struct bt_conn *conn)
|
|||
SET_FLAG(flag_updated);
|
||||
}
|
||||
|
||||
static void unicast_stop_complete_cb(struct bt_bap_unicast_group *unicast_group, int err,
|
||||
struct bt_conn *conn)
|
||||
static void unicast_stop_complete_cb(int err, struct bt_conn *conn)
|
||||
{
|
||||
if (err != 0) {
|
||||
FAIL("Failed to stop (failing conn %p): %d", conn, err);
|
||||
|
@ -545,18 +543,12 @@ static void unicast_audio_start_inval(struct bt_bap_unicast_group *unicast_group
|
|||
valid_stream_param.codec_cfg = &unicast_preset_16_2_1.codec_cfg;
|
||||
|
||||
/* Test NULL parameters */
|
||||
err = bt_cap_initiator_unicast_audio_start(NULL, unicast_group);
|
||||
err = bt_cap_initiator_unicast_audio_start(NULL);
|
||||
if (err == 0) {
|
||||
FAIL("bt_cap_initiator_unicast_audio_start with NULL param did not fail\n");
|
||||
return;
|
||||
}
|
||||
|
||||
err = bt_cap_initiator_unicast_audio_start(&valid_start_param, NULL);
|
||||
if (err == 0) {
|
||||
FAIL("bt_cap_initiator_unicast_audio_start with NULL group did not fail\n");
|
||||
return;
|
||||
}
|
||||
|
||||
/* Test invalid parameters */
|
||||
memcpy(&invalid_stream_param, &valid_stream_param, sizeof(valid_stream_param));
|
||||
memcpy(&invalid_start_param, &valid_start_param, sizeof(valid_start_param));
|
||||
|
@ -564,7 +556,7 @@ static void unicast_audio_start_inval(struct bt_bap_unicast_group *unicast_group
|
|||
|
||||
/* Test invalid stream_start parameters */
|
||||
invalid_start_param.count = 0U;
|
||||
err = bt_cap_initiator_unicast_audio_start(&invalid_start_param, unicast_group);
|
||||
err = bt_cap_initiator_unicast_audio_start(&invalid_start_param);
|
||||
if (err == 0) {
|
||||
FAIL("bt_cap_initiator_unicast_audio_start with 0 count did not fail\n");
|
||||
return;
|
||||
|
@ -574,7 +566,7 @@ static void unicast_audio_start_inval(struct bt_bap_unicast_group *unicast_group
|
|||
invalid_start_param.stream_params = &invalid_stream_param;
|
||||
|
||||
invalid_start_param.stream_params = NULL;
|
||||
err = bt_cap_initiator_unicast_audio_start(&invalid_start_param, unicast_group);
|
||||
err = bt_cap_initiator_unicast_audio_start(&invalid_start_param);
|
||||
if (err == 0) {
|
||||
FAIL("bt_cap_initiator_unicast_audio_start with NULL stream params did not fail\n");
|
||||
return;
|
||||
|
@ -585,7 +577,7 @@ static void unicast_audio_start_inval(struct bt_bap_unicast_group *unicast_group
|
|||
|
||||
/* Test invalid stream_param parameters */
|
||||
invalid_stream_param.member.member = NULL;
|
||||
err = bt_cap_initiator_unicast_audio_start(&invalid_start_param, unicast_group);
|
||||
err = bt_cap_initiator_unicast_audio_start(&invalid_start_param);
|
||||
if (err == 0) {
|
||||
FAIL("bt_cap_initiator_unicast_audio_start with NULL stream params member did not "
|
||||
"fail\n");
|
||||
|
@ -595,7 +587,7 @@ static void unicast_audio_start_inval(struct bt_bap_unicast_group *unicast_group
|
|||
memcpy(&invalid_stream_param, &valid_stream_param, sizeof(valid_stream_param));
|
||||
|
||||
invalid_stream_param.stream = NULL;
|
||||
err = bt_cap_initiator_unicast_audio_start(&invalid_start_param, unicast_group);
|
||||
err = bt_cap_initiator_unicast_audio_start(&invalid_start_param);
|
||||
if (err == 0) {
|
||||
FAIL("bt_cap_initiator_unicast_audio_start with NULL stream params stream did not "
|
||||
"fail\n");
|
||||
|
@ -605,7 +597,7 @@ static void unicast_audio_start_inval(struct bt_bap_unicast_group *unicast_group
|
|||
memcpy(&invalid_stream_param, &valid_stream_param, sizeof(valid_stream_param));
|
||||
|
||||
invalid_stream_param.ep = NULL;
|
||||
err = bt_cap_initiator_unicast_audio_start(&invalid_start_param, unicast_group);
|
||||
err = bt_cap_initiator_unicast_audio_start(&invalid_start_param);
|
||||
if (err == 0) {
|
||||
FAIL("bt_cap_initiator_unicast_audio_start with NULL stream params ep did not "
|
||||
"fail\n");
|
||||
|
@ -615,7 +607,7 @@ static void unicast_audio_start_inval(struct bt_bap_unicast_group *unicast_group
|
|||
memcpy(&invalid_stream_param, &valid_stream_param, sizeof(valid_stream_param));
|
||||
|
||||
invalid_stream_param.codec_cfg = NULL;
|
||||
err = bt_cap_initiator_unicast_audio_start(&invalid_start_param, unicast_group);
|
||||
err = bt_cap_initiator_unicast_audio_start(&invalid_start_param);
|
||||
if (err == 0) {
|
||||
FAIL("bt_cap_initiator_unicast_audio_start with NULL stream params codec did not "
|
||||
"fail\n");
|
||||
|
@ -627,7 +619,7 @@ static void unicast_audio_start_inval(struct bt_bap_unicast_group *unicast_group
|
|||
memset(&invalid_codec.meta, 0, sizeof(invalid_codec.meta));
|
||||
|
||||
invalid_stream_param.codec_cfg = &invalid_codec;
|
||||
err = bt_cap_initiator_unicast_audio_start(&invalid_start_param, unicast_group);
|
||||
err = bt_cap_initiator_unicast_audio_start(&invalid_start_param);
|
||||
if (err == 0) {
|
||||
FAIL("bt_cap_initiator_unicast_audio_start with invalid Codec metadata did not "
|
||||
"fail\n");
|
||||
|
@ -656,7 +648,7 @@ static void unicast_audio_start(struct bt_bap_unicast_group *unicast_group, bool
|
|||
|
||||
UNSET_FLAG(flag_started);
|
||||
|
||||
err = bt_cap_initiator_unicast_audio_start(¶m, unicast_group);
|
||||
err = bt_cap_initiator_unicast_audio_start(¶m);
|
||||
if (err != 0) {
|
||||
FAIL("Failed to start unicast audio: %d\n", err);
|
||||
return;
|
||||
|
@ -1129,7 +1121,7 @@ static int cap_initiator_ac_cap_unicast_start(const struct cap_initiator_ac_para
|
|||
start_param.count = stream_cnt;
|
||||
start_param.type = BT_CAP_SET_TYPE_AD_HOC;
|
||||
|
||||
return bt_cap_initiator_unicast_audio_start(&start_param, unicast_group);
|
||||
return bt_cap_initiator_unicast_audio_start(&start_param);
|
||||
}
|
||||
|
||||
static int cap_initiator_ac_unicast(const struct cap_initiator_ac_param *param,
|
||||
|
|
|
@ -285,8 +285,7 @@ static void cap_discovery_complete_cb(struct bt_conn *conn, int err,
|
|||
SET_FLAG(flag_cas_discovered);
|
||||
}
|
||||
|
||||
static void unicast_start_complete_cb(struct bt_bap_unicast_group *unicast_group, int err,
|
||||
struct bt_conn *conn)
|
||||
static void unicast_start_complete_cb(int err, struct bt_conn *conn)
|
||||
{
|
||||
if (err != 0) {
|
||||
FAIL("Failed to start (failing conn %p): %d\n", conn, err);
|
||||
|
@ -308,8 +307,7 @@ static void unicast_update_complete_cb(int err, struct bt_conn *conn)
|
|||
SET_FLAG(flag_updated);
|
||||
}
|
||||
|
||||
static void unicast_stop_complete_cb(struct bt_bap_unicast_group *unicast_group, int err,
|
||||
struct bt_conn *conn)
|
||||
static void unicast_stop_complete_cb(int err, struct bt_conn *conn)
|
||||
{
|
||||
if (err != 0) {
|
||||
FAIL("Failed to stop (failing conn %p): %d\n", conn, err);
|
||||
|
@ -799,7 +797,7 @@ static int gmap_ac_cap_unicast_start(const struct gmap_unicast_ac_param *param,
|
|||
start_param.count = stream_cnt;
|
||||
start_param.type = BT_CAP_SET_TYPE_AD_HOC;
|
||||
|
||||
return bt_cap_initiator_unicast_audio_start(&start_param, unicast_group);
|
||||
return bt_cap_initiator_unicast_audio_start(&start_param);
|
||||
}
|
||||
|
||||
static int gmap_ac_unicast(const struct gmap_unicast_ac_param *param,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue