Skip to content

Commit fcdb2e5

Browse files
committed
Set max connections for new esp devices correctly
1 parent a1cf703 commit fcdb2e5

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/NimBLEDevice.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -866,11 +866,13 @@ bool NimBLEDevice::init(const std::string& deviceName) {
866866

867867
# if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0) | !defined(CONFIG_NIMBLE_CPP_IDF)
868868
esp_bt_controller_config_t bt_cfg = BT_CONTROLLER_INIT_CONFIG_DEFAULT();
869-
# if defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32S3)
870-
bt_cfg.bluetooth_mode = ESP_BT_MODE_BLE;
871-
# else
869+
# if defined(CONFIG_IDF_TARGET_ESP32)
872870
bt_cfg.mode = ESP_BT_MODE_BLE;
873871
bt_cfg.ble_max_conn = CONFIG_BT_NIMBLE_MAX_CONNECTIONS;
872+
# elif defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32S3)
873+
bt_cfg.ble_max_act = CONFIG_BT_NIMBLE_MAX_CONNECTIONS;
874+
# else
875+
bt_cfg.nimble_max_connections = CONFIG_BT_NIMBLE_MAX_CONNECTIONS;
874876
# endif
875877

876878
# ifdef CONFIG_BTDM_BLE_SCAN_DUPL

0 commit comments

Comments
 (0)