Fix "BLE server / advertising always on" (#4353)

This commit is contained in:
Mat931 2023-01-26 19:09:22 +00:00 committed by GitHub
parent 3e017efa30
commit 034b47c23a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -31,11 +31,13 @@ void ESP32BLE::setup() {
return; return;
} }
#ifdef USE_ESP32_BLE_SERVER
this->advertising_ = new BLEAdvertising(); // NOLINT(cppcoreguidelines-owning-memory) this->advertising_ = new BLEAdvertising(); // NOLINT(cppcoreguidelines-owning-memory)
this->advertising_->set_scan_response(true); this->advertising_->set_scan_response(true);
this->advertising_->set_min_preferred_interval(0x06); this->advertising_->set_min_preferred_interval(0x06);
this->advertising_->start(); this->advertising_->start();
#endif // USE_ESP32_BLE_SERVER
ESP_LOGD(TAG, "BLE setup complete"); ESP_LOGD(TAG, "BLE setup complete");
} }