Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nrf_serial - how to tell available TX buffer space BEFORE using nrf_serial_write()

Hi, 

I'm using nrf_serial 'object' in order to communicate nRF52832 with an external device.

As I work in non-blocking mode I need to verify if there's available space to send a whole message or not send it all. In any case, I shouldn't send a partial message.

I understand that nrf_serial_write()  returns the actual number of bytes queued (sent?) and if its shorter than the full message length it means that only part of the message was sent which is undesirable.

Is there a way to tell in advance if the full message can be queued(sent?) or not (and avoid dealing with partial message queuing(sending)) ?

Thanks

Parents Reply Children
No Data
Related