Hello
I have an application in zephyr with multiple threads and i want to know if it is possible to have a ble service for example the Nordic Uart Service on a thread and still works after the context switch of the scheduler .
Thanks
Jim
Hello
I have an application in zephyr with multiple threads and i want to know if it is possible to have a ble service for example the Nordic Uart Service on a thread and still works after the context switch of the scheduler .
Thanks
Jim
Hi Jim,
Virtually all Zephyr applications (except very basic samples) and all Zephyr Bluetooth applications use several threads (as the stack itself also makes a thread), so I am tempted to say "Yes". However, I am not sure I understand the context of the question. Perhaps you can elaborate a bit?
Hi ,in my application i want to have several threads for sampling a sensor ,processing the raw data and sending some results via Ble when processing is done .I am wondering if i could have start my Bluetooth service in a thread and still continue to work without being interrupted by the context switch with the other threads .
I hope i explained my use case better .
Hi,
I am not sure what you mean by start your bluetooth service "start my Bluetooth service", but generally this should not be a problem. The bluetooth stack itself runs in a different thread itself. And starting things in one thread does not matter. All standard modules in Zephyr and nRF Connect SDK is designed to be used in an RTOS context, where you typically have multiple threads and context switching.
(Of course, if you for some reason have a bug where high priority loop is in a bad state so that is consumes all CPU resources that would cause problems, like it would in any system).