File tree Expand file tree Collapse file tree 4 files changed +8
-6
lines changed Expand file tree Collapse file tree 4 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -866,7 +866,7 @@ void NimBLEDevice::init(const std::string &deviceName) {
866
866
867
867
esp_bt_controller_mem_release (ESP_BT_MODE_CLASSIC_BT);
868
868
869
- # if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0)
869
+ # if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0) || !defined(CONFIG_NIMBLE_CPP_IDF)
870
870
esp_bt_controller_config_t bt_cfg = BT_CONTROLLER_INIT_CONFIG_DEFAULT ();
871
871
# if defined (CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32S3)
872
872
bt_cfg.bluetooth_mode = ESP_BT_MODE_BLE;
@@ -881,7 +881,7 @@ void NimBLEDevice::init(const std::string &deviceName) {
881
881
# endif
882
882
ESP_ERROR_CHECK (esp_bt_controller_init (&bt_cfg));
883
883
ESP_ERROR_CHECK (esp_bt_controller_enable (ESP_BT_MODE_BLE));
884
- ESP_ERROR_CHECK (esp_nimble_hci_init ());
884
+ // ESP_ERROR_CHECK(esp_nimble_hci_init());
885
885
# endif
886
886
#endif
887
887
nimble_port_init ();
@@ -928,7 +928,7 @@ void NimBLEDevice::deinit(bool clearAll) {
928
928
int ret = nimble_port_stop ();
929
929
if (ret == 0 ) {
930
930
nimble_port_deinit ();
931
- #if defined( CONFIG_NIMBLE_CPP_IDF)
931
+ #ifdef CONFIG_NIMBLE_CPP_IDF
932
932
# if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0)
933
933
ret = esp_nimble_hci_and_controller_deinit ();
934
934
if (ret != ESP_OK) {
Original file line number Diff line number Diff line change @@ -191,9 +191,9 @@ void NimBLEServer::start() {
191
191
abort ();
192
192
}
193
193
194
- #if CONFIG_NIMBLE_CPP_LOG_LEVEL >= 4
194
+ // #if CONFIG_NIMBLE_CPP_LOG_LEVEL >= 4
195
195
ble_gatts_show_local ();
196
- #endif
196
+ // #endif
197
197
/* ** Future use ***
198
198
* TODO: implement service changed handling
199
199
Original file line number Diff line number Diff line change @@ -159,7 +159,7 @@ bool NimBLEService::start() {
159
159
// Nimble requires the last characteristic to have it's uuid = 0 to indicate the end
160
160
// of the characteristics for the service. We create 1 extra and set it to null
161
161
// for this purpose.
162
- pChr_a = new ble_gatt_chr_def[numChrs + 1 ];
162
+ pChr_a = new ble_gatt_chr_def[numChrs + 1 ]{} ;
163
163
int i = 0 ;
164
164
for (auto chr_it = m_chrVec.begin (); chr_it != m_chrVec.end (); ++chr_it) {
165
165
if ((*chr_it)->m_removed > 0 ) {
Original file line number Diff line number Diff line change 293
293
#define CONFIG_IDF_TARGET_ESP32 1
294
294
#endif
295
295
296
+ #define CONFIG_BT_NIMBLE_LEGACY_VHCI_ENABLE 1
297
+
296
298
#if CONFIG_BT_NIMBLE_EXT_ADV || CONFIG_BT_NIMBLE_ENABLE_PERIODIC_ADV
297
299
# if defined(CONFIG_IDF_TARGET_ESP32 )
298
300
# error Extended advertising is not supported on ESP32.
You can’t perform that action at this time.
0 commit comments