Skip to content

Commit cbebbd0

Browse files
committed
Fix IDF version check.
1 parent 89bf89f commit cbebbd0

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/NimBLEClient.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -464,8 +464,8 @@ void NimBLEClient::updateConnParams(uint16_t minInterval, uint16_t maxInterval,
464464
* @param [in] tx_octets The preferred number of payload octets to use (Range 0x001B-0x00FB).
465465
*/
466466
void NimBLEClient::setDataLen(uint16_t tx_octets) {
467-
#if defined(CONFIG_NIMBLE_CPP_IDF) && defined(ESP_IDF_VERSION) && \
468-
ESP_IDF_VERSION_MAJOR >= 4 && ESP_IDF_VERSION_MINOR >= 3 && ESP_IDF_VERSION_PATCH >= 2
467+
#if defined(CONFIG_NIMBLE_CPP_IDF) && !defined(ESP_IDF_VERSION) || \
468+
(ESP_IDF_VERSION_MAJOR * 100 + ESP_IDF_VERSION_MINOR * 10 + ESP_IDF_VERSION_PATCH) < 432
469469
return;
470470
#else
471471
uint16_t tx_time = (tx_octets + 14) * 8;

src/NimBLEServer.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,8 @@ NimBLEConnInfo NimBLEServer::getPeerIDInfo(uint16_t id) {
323323
* @param [in] param
324324
*
325325
*/
326-
/*STATIC*/int NimBLEServer::handleGapEvent(struct ble_gap_event *event, void *arg) {
326+
/*STATIC*/
327+
int NimBLEServer::handleGapEvent(struct ble_gap_event *event, void *arg) {
327328
NimBLEServer* server = (NimBLEServer*)arg;
328329
NIMBLE_LOGD(LOG_TAG, ">> handleGapEvent: %s",
329330
NimBLEUtils::gapEventToString(event->type));
@@ -782,8 +783,8 @@ void NimBLEServer::updateConnParams(uint16_t conn_handle,
782783
* @param [in] tx_octets The preferred number of payload octets to use (Range 0x001B-0x00FB).
783784
*/
784785
void NimBLEServer::setDataLen(uint16_t conn_handle, uint16_t tx_octets) {
785-
#if defined(CONFIG_NIMBLE_CPP_IDF) && defined(ESP_IDF_VERSION) && \
786-
ESP_IDF_VERSION_MAJOR >= 4 && ESP_IDF_VERSION_MINOR >= 3 && ESP_IDF_VERSION_PATCH >= 2
786+
#if defined(CONFIG_NIMBLE_CPP_IDF) && !defined(ESP_IDF_VERSION) || \
787+
(ESP_IDF_VERSION_MAJOR * 100 + ESP_IDF_VERSION_MINOR * 10 + ESP_IDF_VERSION_PATCH) < 432
787788
return;
788789
#else
789790
uint16_t tx_time = (tx_octets + 14) * 8;

0 commit comments

Comments
 (0)