Skip to content

Commit 7e7e1aa

Browse files
Thalleynashif
authored andcommitted
Bluetooth: BAP: Fix CONFIG_BT_BAP_BASS_MAX_SUBGROUPS include issue
There were a few cases where CONFIG_BT_BAP_BASS_MAX_SUBGROUPS was used in structs in the public header files. Unfortunately using a Kconfig for an array size will cause include issues if the file is included without the Kconfig being available. For now add and use a new #define value that will be 0 if CONFIG_BT_BAP_BASS_MAX_SUBGROUPS is not defined. Signed-off-by: Emil Gydesen <[email protected]>
1 parent c759b8a commit 7e7e1aa

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

include/zephyr/bluetooth/audio/bap.h

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@
4141
extern "C" {
4242
#endif
4343

44+
#if defined(CONFIG_BT_BAP_BASS_MAX_SUBGROUPS)
45+
#define BT_BAP_BASS_MAX_SUBGROUPS CONFIG_BT_BAP_BASS_MAX_SUBGROUPS
46+
#else
47+
#define BT_BAP_BASS_MAX_SUBGROUPS 0
48+
#endif /* CONFIG_BT_BAP_BASS_MAX_SUBGROUPS*/
49+
4450
/** An invalid Broadcast ID */
4551
#define BT_BAP_INVALID_BROADCAST_ID 0xFFFFFFFFU
4652

@@ -582,7 +588,7 @@ struct bt_bap_scan_delegator_recv_state {
582588
* If the @ref bt_bap_bass_subgroup.bis_sync value is @ref BT_BAP_BIS_SYNC_FAILED then it
583589
* indicates that the BIG sync failed.
584590
*/
585-
struct bt_bap_bass_subgroup subgroups[CONFIG_BT_BAP_BASS_MAX_SUBGROUPS];
591+
struct bt_bap_bass_subgroup subgroups[BT_BAP_BASS_MAX_SUBGROUPS];
586592
};
587593

588594
/**
@@ -676,7 +682,7 @@ struct bt_bap_scan_delegator_cb {
676682
*/
677683
int (*bis_sync_req)(struct bt_conn *conn,
678684
const struct bt_bap_scan_delegator_recv_state *recv_state,
679-
const uint32_t bis_sync_req[CONFIG_BT_BAP_BASS_MAX_SUBGROUPS]);
685+
const uint32_t bis_sync_req[BT_BAP_BASS_MAX_SUBGROUPS]);
680686
/**
681687
* @brief Broadcast Assistant scanning state callback
682688
*
@@ -2377,9 +2383,8 @@ int bt_bap_scan_delegator_set_pa_state(uint8_t src_id,
23772383
* subgroup.
23782384
* @return int Error value. 0 on success, ERRNO on fail.
23792385
*/
2380-
int bt_bap_scan_delegator_set_bis_sync_state(
2381-
uint8_t src_id,
2382-
uint32_t bis_synced[CONFIG_BT_BAP_BASS_MAX_SUBGROUPS]);
2386+
int bt_bap_scan_delegator_set_bis_sync_state(uint8_t src_id,
2387+
uint32_t bis_synced[BT_BAP_BASS_MAX_SUBGROUPS]);
23832388

23842389
/** Parameters for bt_bap_scan_delegator_add_src() */
23852390
struct bt_bap_scan_delegator_add_src_param {
@@ -2399,7 +2404,7 @@ struct bt_bap_scan_delegator_add_src_param {
23992404
uint8_t num_subgroups;
24002405

24012406
/** Subgroup specific information */
2402-
struct bt_bap_bass_subgroup subgroups[CONFIG_BT_BAP_BASS_MAX_SUBGROUPS];
2407+
struct bt_bap_bass_subgroup subgroups[BT_BAP_BASS_MAX_SUBGROUPS];
24032408
};
24042409

24052410
/**
@@ -2437,7 +2442,7 @@ struct bt_bap_scan_delegator_mod_src_param {
24372442
* If a subgroup's metadata_len is set to 0, the existing metadata
24382443
* for the subgroup will remain unchanged
24392444
*/
2440-
struct bt_bap_bass_subgroup subgroups[CONFIG_BT_BAP_BASS_MAX_SUBGROUPS];
2445+
struct bt_bap_bass_subgroup subgroups[BT_BAP_BASS_MAX_SUBGROUPS];
24412446
};
24422447

24432448
/**

include/zephyr/bluetooth/audio/cap.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -918,7 +918,7 @@ struct bt_cap_commander_broadcast_reception_start_member_param {
918918
*
919919
* At least one bit in one of the subgroups bis_sync parameters shall be set.
920920
*/
921-
struct bt_bap_bass_subgroup subgroups[CONFIG_BT_BAP_BASS_MAX_SUBGROUPS];
921+
struct bt_bap_bass_subgroup subgroups[BT_BAP_BASS_MAX_SUBGROUPS];
922922

923923
/** Number of subgroups */
924924
size_t num_subgroups;

0 commit comments

Comments
 (0)