From 4a8946786e24c593da117a458007f7a75269baef Mon Sep 17 00:00:00 2001 From: mfarag13 Date: Mon, 1 Apr 2019 12:59:00 +0200 Subject: [PATCH] nimble/hci: Modifying ACL Buf size based on BLE 5.1 Standard --- nimble/host/src/ble_hs_hci.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/nimble/host/src/ble_hs_hci.c b/nimble/host/src/ble_hs_hci.c index f9167ff0b..a620d24d4 100644 --- a/nimble/host/src/ble_hs_hci.c +++ b/nimble/host/src/ble_hs_hci.c @@ -407,13 +407,17 @@ ble_hs_hci_rx_evt(uint8_t *hci_ev, void *arg) } /** - * Calculates the largest ACL payload that the controller can accept. This is - * everything in an ACL data packet except for the ACL header. + * Calculates the largest ACL payload that the controller can accept. */ static uint16_t ble_hs_hci_max_acl_payload_sz(void) { - return ble_hs_hci_buf_sz - BLE_HCI_DATA_HDR_SZ; + /* As per BLE 5.1 Standard, Vol. 2, Part E, section 7.8.2: + * The LE_Read_Buffer_Size command is used to read the maximum size of the + * data portion of HCI LE ACL Data Packets sent from the Host to the + * Controller. + */ + return ble_hs_hci_buf_sz; } /**