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

Serial library event handler example

Hi,

Does anyone have a complete example of using an event handler to read UART data set up with the serial library? This post is the only incomplete example I can find. The example program sets _ev_handler to NULL in the setup NRF_SERIAL_CONFIG_DEF

OR my devices needs to constantly read continuous incoming UART data, so does someone have the best practice on reading the serial so the buffer doesn't overflow? Thanks

Parents
  • The event handler will be called on every NRF_DRV_UART_EVT_RX_DONE event from the UART driver. This will either happen when the number of bytes passed to the size parameter of nrf_serial_read() have been received, or when the timeout have been reached.

  • I am afraid that the  event handler will be called on every single byte received by the UART. No matter the "nrf_serial_read" parameters.

    Could you kindly share with us an example use event handler for receive more than one byte?

Reply
  • I am afraid that the  event handler will be called on every single byte received by the UART. No matter the "nrf_serial_read" parameters.

    Could you kindly share with us an example use event handler for receive more than one byte?

Children
No Data