From 2e498cef2b30c56e42f22d93241b3db7f6fd147b Mon Sep 17 00:00:00 2001 From: h2zero Date: Sun, 6 Feb 2022 12:58:26 -0700 Subject: [PATCH] Fix IDF version check. --- src/NimBLEClient.cpp | 4 ++-- src/NimBLEServer.cpp | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/NimBLEClient.cpp b/src/NimBLEClient.cpp index 0abb408..7b87ab3 100644 --- a/src/NimBLEClient.cpp +++ b/src/NimBLEClient.cpp @@ -464,8 +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) { -#if defined(CONFIG_NIMBLE_CPP_IDF) && defined(ESP_IDF_VERSION) && \ - ESP_IDF_VERSION_MAJOR >= 4 && ESP_IDF_VERSION_MINOR >= 3 && ESP_IDF_VERSION_PATCH >= 2 +#if defined(CONFIG_NIMBLE_CPP_IDF) && !defined(ESP_IDF_VERSION) || \ + (ESP_IDF_VERSION_MAJOR * 100 + ESP_IDF_VERSION_MINOR * 10 + ESP_IDF_VERSION_PATCH) < 432 return; #else uint16_t tx_time = (tx_octets + 14) * 8; diff --git a/src/NimBLEServer.cpp b/src/NimBLEServer.cpp index c7aeb64..03ee785 100644 --- a/src/NimBLEServer.cpp +++ b/src/NimBLEServer.cpp @@ -323,7 +323,8 @@ NimBLEConnInfo NimBLEServer::getPeerIDInfo(uint16_t id) { * @param [in] param * */ -/*STATIC*/int NimBLEServer::handleGapEvent(struct ble_gap_event *event, void *arg) { +/*STATIC*/ +int NimBLEServer::handleGapEvent(struct ble_gap_event *event, void *arg) { NimBLEServer* server = (NimBLEServer*)arg; NIMBLE_LOGD(LOG_TAG, ">> handleGapEvent: %s", NimBLEUtils::gapEventToString(event->type)); @@ -782,8 +783,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) { -#if defined(CONFIG_NIMBLE_CPP_IDF) && defined(ESP_IDF_VERSION) && \ - ESP_IDF_VERSION_MAJOR >= 4 && ESP_IDF_VERSION_MINOR >= 3 && ESP_IDF_VERSION_PATCH >= 2 +#if defined(CONFIG_NIMBLE_CPP_IDF) && !defined(ESP_IDF_VERSION) || \ + (ESP_IDF_VERSION_MAJOR * 100 + ESP_IDF_VERSION_MINOR * 10 + ESP_IDF_VERSION_PATCH) < 432 return; #else uint16_t tx_time = (tx_octets + 14) * 8;