Skip to content

Commit efaa9d9

Browse files
committed
ESP32: handle nimble_port_init's return values based on idf version
nimble_port_init() on idf v5.0.1 and prior returns void, and from v5.0.2 it returns esp_err_t.
1 parent ee95bd2 commit efaa9d9

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/platform/ESP32/nimble/BLEManagerImpl.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -942,8 +942,13 @@ CHIP_ERROR BLEManagerImpl::InitESPBleLayer(void)
942942
SuccessOrExit(err);
943943
#endif
944944

945+
// For ESP-IDF 5.0.1 and below, nimble_port_init() returns void
946+
#if ESP_IDF_VERSION <= ESP_IDF_VERSION_VAL(5, 0, 1)
947+
nimble_port_init();
948+
#else
945949
err = MapBLEError(nimble_port_init());
946950
SuccessOrExit(err);
951+
#endif
947952

948953
/* Initialize the NimBLE host configuration. */
949954
ble_hs_cfg.reset_cb = bleprph_on_reset;

0 commit comments

Comments
 (0)