Good morning all,
I’m new to FreeRTOS and currently pondering about the return value of
A return value of 0 is returned if
- either a timeout occured on an empty message buffer or
- the length of the message exceeds the size of the copy buffer passed as parameter
The receiving end could remedy the second case by providing a bigger copy buffer - if it were aware of this situation but the current message buffer API does not offer the required information.
While the sender can use
xMessageBufferSpacesAvailable() to check if a message-to-be-sent would fit into the message buffer, the receiver has no corresponding API function to check the size of a pending message.
I wonder why this.
Is it because sender and receiver need to have a separate means to convey buffer overflow situations anyway? For example, if the sender has a message to send that does not fit into the message buffer (because the receiver does not read from the message buffer fast enough or the message exceeds the total size of message buffer), I assume the sender has to notify the receveir anyway.