esp-nimble-cpp icon indicating copy to clipboard operation
esp-nimble-cpp copied to clipboard

ESP3232S3 Crash when service not started, but is advertised.

Open AndrewMagpie opened this issue 3 years ago • 1 comments

When a service isn't started but is advertised a crash occurs.

#define SERVICE_UUID_128 "ca65f688-5a42-4e4a-b19f-e59e70758573"
BLEServer*  pServer = BLEDevice::createServer();
BLEService * pService128 = pServer->createService(SERVICE_UUID_128);
//pService128->start();   //if you dont start a service, a crash occurs.

BLEAdvertising* pAdvertising = BLEDevice::getAdvertising();
pAdvertising->setScanResponse(true);
pAdvertising->setAppearance(0x0140);  //Appearance=Display

if (pService128)
    pAdvertising->addServiceUUID(pService128->getUUID());

bIsAdvertising = pAdvertising->start();  //KABOOM

Is this expected behaviour?

AndrewMagpie avatar Sep 09 '22 03:09 AndrewMagpie

Hmm, can't say I've ever tried this or seen this done before but it should certainly not crash. Thanks for reporting, I will look into it.

h2zero avatar Sep 09 '22 03:09 h2zero