[Bugfix] NimBLEDevice::createServer can crash if stack not initialized.

* [Bugfix] NimBLEDevice::createServer can crash if stack not initialized.

This removes the gatts/gap reset calls from NimBLEDevice::createServer so that it can be safely used before initializing the stack.

This also deprecates NimBLEService::start the the services will now be added/created only when the server is started.
This commit is contained in:
Ryan Powell
2026-03-17 13:47:57 -06:00
committed by h2zero
parent 83fb1dfef8
commit 9d6e48caa4
10 changed files with 48 additions and 55 deletions
-4
View File
@@ -184,10 +184,6 @@ extern "C" void app_main(void) {
pC01Ddsc->setValue("Send it back!");
pC01Ddsc->setCallbacks(&dscCallbacks);
/** Start the services when finished creating all Characteristics and Descriptors */
pDeadService->start();
pBaadService->start();
/** Create an advertising instance and add the services to the advertised data */
NimBLEAdvertising* pAdvertising = NimBLEDevice::getAdvertising();
pAdvertising->setName("NimBLE-Server");