From 42a35aa2f4fcbd0ca91331492afdf9388a0c8cc7 Mon Sep 17 00:00:00 2001 From: Prasad Alatkar Date: Wed, 30 Dec 2020 23:38:02 +0530 Subject: [PATCH] NimBLE: Make LE data length set API public - Helps to set LE data length in controller from host. --- nimble/host/include/host/ble_gap.h | 17 +++++++++++++++++ nimble/host/src/ble_hs_hci_priv.h | 2 -- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/nimble/host/include/host/ble_gap.h b/nimble/host/include/host/ble_gap.h index 834102323..d99d424e8 100644 --- a/nimble/host/include/host/ble_gap.h +++ b/nimble/host/include/host/ble_gap.h @@ -1139,6 +1139,23 @@ int ble_gap_adv_set_fields(const struct ble_hs_adv_fields *rsp_fields); */ int ble_gap_adv_rsp_set_fields(const struct ble_hs_adv_fields *rsp_fields); +/** + * Configure LE Data Length in controller (OGF = 0x08, OCF = 0x0022). + * + * @param conn_handle Connection handle. + * @param tx_octets The preferred value of payload octets that the Controller + * should use for a new connection (Range + * 0x001B-0x00FB). + * @param tx_time The preferred maximum number of microseconds that the local Controller + * should use to transmit a single link layer packet + * (Range 0x0148-0x4290). + * + * @return 0 on success, + * other error code on failure. + */ +int ble_hs_hci_util_set_data_len(uint16_t conn_handle, uint16_t tx_octets, + uint16_t tx_time); + #if MYNEWT_VAL(BLE_EXT_ADV) /** @brief Extended advertising parameters */ struct ble_gap_ext_adv_params { diff --git a/nimble/host/src/ble_hs_hci_priv.h b/nimble/host/src/ble_hs_hci_priv.h index d1098594a..362f12cbd 100644 --- a/nimble/host/src/ble_hs_hci_priv.h +++ b/nimble/host/src/ble_hs_hci_priv.h @@ -100,8 +100,6 @@ int ble_hs_hci_util_read_adv_tx_pwr(int8_t *out_pwr); int ble_hs_hci_util_rand(void *dst, int len); int ble_hs_hci_util_read_rssi(uint16_t conn_handle, int8_t *out_rssi); int ble_hs_hci_util_set_random_addr(const uint8_t *addr); -int ble_hs_hci_util_set_data_len(uint16_t conn_handle, uint16_t tx_octets, - uint16_t tx_time); int ble_hs_hci_util_data_hdr_strip(struct os_mbuf *om, struct hci_data_hdr *out_hdr); int ble_hs_hci_evt_process(const struct ble_hci_ev *ev);