NimBLE-Arduino
NimBLE-Arduino copied to clipboard
Are there examples of how to run tasks on the Nimble stack core?
In the usage tips document it is stated that it is best to use the library from a task that runs on the Nimble stack core in stead of the normal core.
An example of how to do this would be good. But actually a pointer to code that does this would also be helpful already...
There are examples in the esp-nimble-cpp repo that do this, for instance https://github.com/h2zero/esp-nimble-cpp/blob/master/examples/basic/BLE_scan/main/main.cpp
Ah, thanks, that's a very useful repo! A few remarks:
- I have the feeling that the
BLE_scanexample you're referring to has a bug: it seems likepBLE->start()isn't called (or maybe I'm overlooking it) NimBLE_Clientseems like a better example (it does quite a bit more in the task, and also shows one way of communicating between the tasks, using a shared variable)- Maybe add a reference to this repo in the documentation?
That example is in the master branch which has some API changes, the blocking scan call no longer uses start() instead the getResults() call replaces it.
Yes the Client example is probably better but for simplicity I used the scan example.
There is a reference in the README, perhaps it should be made more apparent though.