From 06fe2a4d75697f32b440d7e6a59ab3589f14a6cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Kopy=C5=9Bci=C5=84ski?= Date: Wed, 15 Nov 2023 14:19:23 +0100 Subject: [PATCH] controller/ble_ll_hci: fix ble_ll_hci_le_read_bufsize_v2 compilation ISO can be used without connection (for example for Auracast). Then, g_ble_ll_data has no ACL members and compilation will fail. --- nimble/controller/src/ble_ll_hci.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/nimble/controller/src/ble_ll_hci.c b/nimble/controller/src/ble_ll_hci.c index af46653945..356869eee6 100644 --- a/nimble/controller/src/ble_ll_hci.c +++ b/nimble/controller/src/ble_ll_hci.c @@ -355,8 +355,14 @@ ble_ll_hci_le_read_bufsize_v2(uint8_t *rspbuf, uint8_t *rsplen) { struct ble_hci_le_rd_buf_size_v2_rp *rp = (void *) rspbuf; + +#if MYNEWT_VAL(BLE_LL_ROLE_CENTRAL) || MYNEWT_VAL(BLE_LL_ROLE_PERIPHERAL) rp->data_len = htole16(g_ble_ll_data.ll_acl_pkt_size); rp->data_packets = g_ble_ll_data.ll_num_acl_pkts; +#else + rp->data_len = 0; + rp->data_packets = 0; +#endif rp->iso_data_len = htole16(g_ble_ll_data.ll_iso_pkt_size); rp->iso_data_packets = g_ble_ll_data.ll_num_iso_pkts;