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 byte data coming in is a proprietary protocol. I need to store the data in a big buffer and search for the start / end bytes for each message and then parse the message. I do have a timing requirement. Once I receive the end byte for a given message, the program needs to respond by sending a msg on the serial within 300us - 6.0ms. It seems to me using the event handler is better for this than always querying the serial queue with a timer?

Reply
  • The byte data coming in is a proprietary protocol. I need to store the data in a big buffer and search for the start / end bytes for each message and then parse the message. I do have a timing requirement. Once I receive the end byte for a given message, the program needs to respond by sending a msg on the serial within 300us - 6.0ms. It seems to me using the event handler is better for this than always querying the serial queue with a timer?

Children
No Data
Related