nkolban / esp32-snippets

Sample ESP32 snippets and code fragments
https://leanpub.com/kolban-ESP32
Apache License 2.0
2.37k stars 710 forks source link

ESP32 BLE Async #1051

Open JLightMedia opened 3 years ago

JLightMedia commented 3 years ago

I have a not typical question. Is it possible to move all BLE tasks to a different thread to execute independently? I founded an example "FreeRTOS". Is it possible to apply the same program algorithm for BLE? The main goal is don't block the main loop during connecting, searching, and other BLE stuff.

chegewara commented 3 years ago

Yes, you can run BLE from separate task.

JLightMedia commented 3 years ago

Is there any code example for server and client?

chegewara commented 3 years ago

Just create new task and run ble as usual in that new task, unless we are speaking about 2 different things.

JLightMedia commented 3 years ago

Ok, thank you. I'll try that.