Hello,
since some months I am working on a ESP32-Project for the first time and it is going on well. But now I have a great problem with BLE. (So far I am using Neil Kolban's cpp_utils from his esp32-snippets github repository for BLE.)
I need to shut down all BLE activities for ~200msec and than restart the same services and characteristics I have used before. Is there any option to set only BLE to sleep and wake it up again while other my tasks proceed?
I tried to stop advertising, but something still disturbs my time critical task that I have to execute in the meanwhile. (Without using "pServer->getAdvertising()->start()" at all, everything works fine. So the disturbance of my timing is due to BLE and I do need BLE before and after this break. What ever I have done to stop and start BLE again (BLEDevice::deinit/BLEDevice::init; stop/start Service,...) leads to the error massage "E(3229) BLECharacteristic: Characteristic already has a handle". I do not find any solution to get rid of this error.)
Does anyone have a hint how to stop and restart BLE on ESP32?
Thanks to all,
JJens
Restart BLE after 200msec timeout
Re: Restart BLE after 200msec timeout
After stop service try:
But i dont think you need to stop services and deinit BLE. If you disconnect ble devices and stop advertising then it should be enough (there may be issue with stop advertising, which is re-starting).
Code: Select all
delete(service); // service is pointer to service
Re: Restart BLE after 200msec timeout
@Chegewara:
thanks for your reply, delete(service) solves my problem.
(Somehow only disconnecting devices and stop advertising still disturbed my timing, maybe due to some internal interrupts.)
thanks for your reply, delete(service) solves my problem.
(Somehow only disconnecting devices and stop advertising still disturbed my timing, maybe due to some internal interrupts.)
Who is online
Users browsing this forum: forrest, Majestic-12 [Bot] and 138 guests