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

Does simple_uart example buffer?

I've been playing with the simple_uart example and it seems like it might be missing responses. Does it buffer incoming data until the simple_uart_get() is called?

Parents
  • So does the app_uart library provide better buffering support? It looks like you can configure the buffer size on the app_uart_init() call.

    The devices I"m working with do not support flow control, but they work on a simple request-response protocol so I don't need to buffer unsolicited data, but I do have to handle the incoming responses after my request.

  • app_uart does provide a different buffering mechanism, but if the peer device doesn't support flow control you should expect losing bytes if you have a BLE connection ongoing. The reason is that a connection event will block the CPU for several hundred microseconds, in which case the UART buffer will not be emptied, again possibly causing bytes to be lost if the peer device doesn't stop sending.

    Take a look at the S110 SoftDevice Specification for details on the blocking caused by the softdevice.

Reply
  • app_uart does provide a different buffering mechanism, but if the peer device doesn't support flow control you should expect losing bytes if you have a BLE connection ongoing. The reason is that a connection event will block the CPU for several hundred microseconds, in which case the UART buffer will not be emptied, again possibly causing bytes to be lost if the peer device doesn't stop sending.

    Take a look at the S110 SoftDevice Specification for details on the blocking caused by the softdevice.

Children
No Data
Related