From 830c4cc39e05557f77ff9b9ff8a16a50ccddd62a Mon Sep 17 00:00:00 2001 From: h2zero Date: Sat, 15 Jan 2022 08:49:51 -0700 Subject: [PATCH] Re-enable data length extension newer IDF versions. --- src/NimBLEClient.cpp | 3 ++- src/NimBLEServer.cpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/NimBLEClient.cpp b/src/NimBLEClient.cpp index 60886d5..5b71c5f 100644 --- a/src/NimBLEClient.cpp +++ b/src/NimBLEClient.cpp @@ -464,7 +464,8 @@ void NimBLEClient::updateConnParams(uint16_t minInterval, uint16_t maxInterval, * @param [in] tx_octets The preferred number of payload octets to use (Range 0x001B-0x00FB). */ void NimBLEClient::setDataLen(uint16_t tx_octets) { -#ifdef CONFIG_NIMBLE_CPP_IDF // not yet available in IDF, Sept 9 2021 +#if defined(CONFIG_NIMBLE_CPP_IDF) && defined(ESP_IDF_VERSION) && \ + ESP_IDF_VERSION <= ESP_IDF_VERSION_VAL(4,3,2) return; #else uint16_t tx_time = (tx_octets + 14) * 8; diff --git a/src/NimBLEServer.cpp b/src/NimBLEServer.cpp index fd28582..11a28d0 100644 --- a/src/NimBLEServer.cpp +++ b/src/NimBLEServer.cpp @@ -785,7 +785,8 @@ void NimBLEServer::updateConnParams(uint16_t conn_handle, * @param [in] tx_octets The preferred number of payload octets to use (Range 0x001B-0x00FB). */ void NimBLEServer::setDataLen(uint16_t conn_handle, uint16_t tx_octets) { -#ifdef CONFIG_NIMBLE_CPP_IDF // not yet available in IDF, Sept 9 2021 +#if defined(CONFIG_NIMBLE_CPP_IDF) && defined(ESP_IDF_VERSION) && \ + ESP_IDF_VERSION <= ESP_IDF_VERSION_VAL(4,3,2) return; #else uint16_t tx_time = (tx_octets + 14) * 8;