NimBLE-Arduino icon indicating copy to clipboard operation
NimBLE-Arduino copied to clipboard

How to stop a service?

Open AndrewMagpie opened this issue 3 years ago • 2 comments

There is a bool NimBLEService::start() But no bool NimBLEService::stop(), unlike the nkolban version.

How does one stop a service?

AndrewMagpie avatar Aug 10 '22 07:08 AndrewMagpie

The NimBLE stack does not support stopping a service the way the bluedroid stack does. Instead it can "hide" it or delete it completely. For this to work advertising must be stopped first.

The function to do this is in NimBLEServer: void NimBLEServer::removeService(NimBLEService* service, bool deleteSvc = false);

h2zero avatar Aug 10 '22 13:08 h2zero

@h2zero except this appears not to work.. see #541

sdetweil avatar May 10 '23 20:05 sdetweil