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

How to disable buffer in Nordic Uart Service?

I'm trying to replace a RS232 cable with a BLE bridge with the Nordic Uart Service.

One nRF52832 configured as central (app_uart_example_central) and an other one as peripheral. The connection is working well with putty or the nRF connect app on the phone. But there is a 60 character buffer and I can't find the code to change it.

Does someone know how to disable that buffer to send incoming data as it comes?

Details: Chip: nRF52832 IDE: Keil5.23 Softdevice: s132

Parents
  • Hi Hermann

    I don't think removing the buffer is the best option, since having the buffer is a good way to ensure you can send larger chunks of data at once, but what you can do is to add some code to empty the buffer more aggressively.

    For instance you can set up an app_timer callback that checks the buffer every N milliseconds, and sends whatever is in the buffer as long as it is not empty. Then you know that your data will be sent on certain intervals, even if you haven't filled the buffer first.

    Best regards
    Torbjørn

Reply
  • Hi Hermann

    I don't think removing the buffer is the best option, since having the buffer is a good way to ensure you can send larger chunks of data at once, but what you can do is to add some code to empty the buffer more aggressively.

    For instance you can set up an app_timer callback that checks the buffer every N milliseconds, and sends whatever is in the buffer as long as it is not empty. Then you know that your data will be sent on certain intervals, even if you haven't filled the buffer first.

    Best regards
    Torbjørn

Children
No Data
Related