Skip to content

Commit 6a0cdb4

Browse files
Andries Kruithofaescolar
authored andcommitted
Bluetooth: CAP: Commander Reception start procedure
Add the CAP commander reception start procedure which starts reception on one or more CAP acceptors With the implementation of broadcast reception start procedure we also need some mockups for unit testing Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
1 parent 7d5ccc0 commit 6a0cdb4

File tree

9 files changed

+403
-33
lines changed

9 files changed

+403
-33
lines changed

include/zephyr/bluetooth/audio/cap.h

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,20 @@ struct bt_cap_commander_cb {
750750
void (*microphone_gain_changed)(struct bt_conn *conn, int err);
751751
#endif /* CONFIG_BT_MICP_MIC_CTLR_AICS */
752752
#endif /* CONFIG_BT_MICP_MIC_CTLR */
753+
754+
#if defined(CONFIG_BT_BAP_BROADCAST_ASSISTANT)
755+
/**
756+
* @brief Callback for bt_cap_commander_broadcast_reception_start().
757+
*
758+
* @param conn Pointer to the connection where the error
759+
* occurred. NULL if @p err is 0 or if cancelled by
760+
* bt_cap_commander_cancel()
761+
* @param err 0 on success, BT_GATT_ERR() with a
762+
* specific ATT (BT_ATT_ERR_*) error code or -ECANCELED if cancelled
763+
* by bt_cap_commander_cancel().
764+
*/
765+
void (*broadcast_reception_start)(struct bt_conn *conn, int err);
766+
#endif /* CONFIG_BT_BAP_BROADCAST_ASSISTANT */
753767
};
754768

755769
/**
@@ -842,7 +856,7 @@ struct bt_cap_commander_broadcast_reception_start_member_param {
842856
*
843857
* At least one bit in one of the subgroups bis_sync parameters shall be set.
844858
*/
845-
struct bt_bap_bass_subgroup *subgroups;
859+
struct bt_bap_bass_subgroup subgroups[CONFIG_BT_BAP_BASS_MAX_SUBGROUPS];
846860

847861
/** Number of subgroups */
848862
size_t num_subgroups;

subsys/bluetooth/audio/bap_internal.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,3 +123,16 @@ static inline const char *bt_bap_big_enc_state_str(uint8_t state)
123123
return "unknown state";
124124
}
125125
}
126+
127+
static inline bool valid_bis_syncs(uint32_t bis_sync)
128+
{
129+
if (bis_sync == BT_BAP_BIS_SYNC_NO_PREF) {
130+
return true;
131+
}
132+
133+
if (bis_sync > BIT_MASK(31)) { /* Max BIS index */
134+
return false;
135+
}
136+
137+
return true;
138+
}

subsys/bluetooth/audio/bap_scan_delegator.c

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -88,19 +88,6 @@ static bool bits_subset_of(uint32_t a, uint32_t b)
8888
return (((a) & (~(b))) == 0);
8989
}
9090

91-
static bool valid_bis_syncs(uint32_t bis_sync)
92-
{
93-
if (bis_sync == BT_BAP_BIS_SYNC_NO_PREF) {
94-
return true;
95-
}
96-
97-
if (bis_sync > BIT_MASK(31)) { /* Max BIS index */
98-
return false;
99-
}
100-
101-
return true;
102-
}
103-
10491
static bool bis_syncs_unique_or_no_pref(uint32_t requested_bis_syncs,
10592
uint32_t aggregated_bis_syncs)
10693
{

0 commit comments

Comments
 (0)