firmware
IEM Firmware Documentation
Loading...
Searching...
No Matches
xMessageBufferSpaceAvailable
Collaboration diagram for xMessageBufferSpaceAvailable:

message_buffer.h

StreamBufferHandle_t MessageBufferHandle_t
Definition message_buffer.h:86
#define xMessageBufferSpaceAvailable(xMessageBuffer)
Definition message_buffer.h:846

Returns the number of bytes of free space in the message buffer.

configUSE_STREAM_BUFFERS must be set to 1 in for FreeRTOSConfig.h for xMessageBufferSpaceAvailable() to be available.

Parameters
xMessageBufferThe handle of the message buffer being queried.
Returns
The number of bytes that can be written to the message buffer before the message buffer would be full. When a message is written to the message buffer an additional sizeof( size_t ) bytes are also written to store the message's length. sizeof( size_t ) is typically 4 bytes on a 32-bit architecture, so if xMessageBufferSpacesAvailable() returns 10, then the size of the largest message that can be written to the message buffer is 6 bytes.