diff --git a/subsys/bluetooth/audio/bap_broadcast_assistant.c b/subsys/bluetooth/audio/bap_broadcast_assistant.c index 07f83bd7c1..8f9a773284 100644 --- a/subsys/bluetooth/audio/bap_broadcast_assistant.c +++ b/subsys/bluetooth/audio/bap_broadcast_assistant.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -64,7 +65,8 @@ static struct bt_bap_broadcast_assistant_cb *broadcast_assistant_cbs; static struct bap_broadcast_assistant_instance broadcast_assistant; static struct bt_uuid_16 uuid = BT_UUID_INIT_16(0); -NET_BUF_SIMPLE_DEFINE_STATIC(cp_buf, CONFIG_BT_L2CAP_TX_MTU); +#define CP_BUF_SIZE MAX(CONFIG_BT_L2CAP_TX_MTU, BT_ATT_MAX_ATTRIBUTE_LEN) +NET_BUF_SIMPLE_DEFINE_STATIC(cp_buf, CP_BUF_SIZE); static int16_t lookup_index_by_handle(uint16_t handle) { @@ -973,6 +975,7 @@ int bt_bap_broadcast_assistant_read_recv_state(struct bt_conn *conn, broadcast_assistant.read_params.single.handle = broadcast_assistant.recv_state_handles[idx]; + /* we do not need a semaphore for the read_params long read I think */ err = bt_gatt_read(conn, &broadcast_assistant.read_params); if (err != 0) { (void)memset(&broadcast_assistant.read_params, 0,