This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to poll BLE events using nrf_sdh_evts_poll()? Please let me know if there is an example?

What I need?

I should be able to perform scanning, connecting, disconnecting and accessing service from main() (in a infinite while loop) rather than interrupts. I see that there is an API nrf_sdh_evts_poll(), but I am not able to get my application working with it. Please let me know if you have any example using BLE via polling.

Why I need this?

the nRF52840 chip is connected to a computer via UART and I'm not able to receive data at 115200 baud rate with hardware flow control when BLE is enabled (due to high priority interrupts). If I can access the BLE events in the main loop, then it would not harm UART data reception as there is no BLE interrupts.

Details:

SDK: 15.3

SD: s140_nrf52_6.1.1

MCU: nRF52840 in BLE central mode.

I'm stuck at a critical stage of my development, any help is highly appriciated.