Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs

The function that could get the data from the computer in nRF5 SDK at any time

Hi,

I use the modified version of the USBD example(nRF5_SDK_17.1.0_ddde560\examples\peripheral\usbd) in nRF5 SDK from here. (My development kit is nRF52840DK.)

And I would like to add some funtions like the peripheral_uart sample(ncs\v1.7.0\nrf\samples\bluetooth\peripheral_uart) in NCS shown in the picture below.

I have to write the data from the keyboard to the development kit through the endpoint, so I need a similar function to use in nRF5 SDK like k_fifo_get and ble_write_thread that could let the development kit monitor whether there is data from the computer at any time.

Is there any funtion I could use in nRF5 SDK? Or is there any example I could refer to?

With kind regards

Ning

Related