From d31899d9a2bb350dc83c1ceb3cebdebe1ed6d5dc Mon Sep 17 00:00:00 2001 From: Onkar Date: Thu, 21 Apr 2022 11:30:24 +0530 Subject: [PATCH] Support for Read and Write Suggested Datalen cmds --- nimble/host/include/host/ble_gap.h | 63 ++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/nimble/host/include/host/ble_gap.h b/nimble/host/include/host/ble_gap.h index 488472dd4..fc04aa00c 100644 --- a/nimble/host/include/host/ble_gap.h +++ b/nimble/host/include/host/ble_gap.h @@ -1327,6 +1327,38 @@ int ble_gap_adv_rsp_set_fields(const struct ble_hs_adv_fields *rsp_fields); int ble_hs_hci_util_set_data_len(uint16_t conn_handle, uint16_t tx_octets, uint16_t tx_time); +/** + * Read host's suggested values for the controller's maximum transmitted number of payload octets + * and maximum packet transmission time (OGF = 0x08, OCF = 0x0024). + * + * @param out_sugg_max_tx_octets The Host's suggested value for the Controller's maximum transmitted + * number of payload octets in LL Data PDUs to be used for new + * connections. (Range 0x001B-0x00FB). + * @param out_sugg_max_tx_time The Host's suggested value for the Controller's maximum packet + * transmission time for packets containing LL Data PDUs to be used + * for new connections. (Range 0x0148-0x4290). + * + * @return 0 on success, + * other error code on failure. + */ +int ble_hs_hci_util_read_sugg_def_data_len(uint16_t *out_sugg_max_tx_octets, + uint16_t *out_sugg_max_tx_time); +/** + * Configure host's suggested maximum transmitted number of payload octets and maximum packet + * transmission time in controller (OGF = 0x08, OCF = 0x0024). + * + * @param sugg_max_tx_octets The Host's suggested value for the Controller's maximum transmitted + * number of payload octets in LL Data PDUs to be used for new + * connections. (Range 0x001B-0x00FB). + * @param sugg_max_tx_time The Host's suggested value for the Controller's maximum packet + * transmission time for packets containing LL Data PDUs to be used + * for new connections. (Range 0x0148-0x4290). + * + * @return 0 on success, + * other error code on failure. + */ +int ble_hs_hci_util_write_sugg_def_data_len(uint16_t sugg_max_tx_octets, uint16_t sugg_max_tx_time); + #if MYNEWT_VAL(BLE_EXT_ADV) /** @brief Extended advertising parameters */ struct ble_gap_ext_adv_params { @@ -2082,6 +2114,37 @@ int ble_gap_read_sugg_def_data_len(uint16_t *out_sugg_max_tx_octets, int ble_gap_write_sugg_def_data_len(uint16_t sugg_max_tx_octets, uint16_t sugg_max_tx_time); +/** + * Read LE Suggested Default Data Length in controller (OGF = 0x08, OCF = 0x0024). + * + * @param out_sugg_max_tx_octets The Host's suggested value for the Controller's maximum transmitted + * number of payload octets in LL Data PDUs to be used for new + * connections. (Range 0x001B-0x00FB). + * @param out_sugg_max_tx_time The Host's suggested value for the Controller's maximum packet + * transmission time for packets containing LL Data PDUs to be used + * for new connections. (Range 0x0148-0x4290). + * + * @return 0 on success, + * other error code on failure. + */ +int ble_gap_read_sugg_def_data_len(uint16_t *out_sugg_max_tx_octets, + uint16_t *out_sugg_max_tx_time); + +/** + * Configure LE Suggested Default Data Length in controller (OGF = 0x08, OCF = 0x0024). + * + * @param sugg_max_tx_octets The Host's suggested value for the Controller's maximum transmitted + * number of payload octets in LL Data PDUs to be used for new + * connections. (Range 0x001B-0x00FB). + * @param sugg_max_tx_time The Host's suggested value for the Controller's maximum packet + * transmission time for packets containing LL Data PDUs to be used + * for new connections. (Range 0x0148-0x4290). + * + * @return 0 on success, + * other error code on failure. + */ +int ble_gap_write_sugg_def_data_len(uint16_t sugg_max_tx_octets, uint16_t sugg_max_tx_time); + /** * Initiates the GAP security procedure. *