Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
xMessageBufferSpaceAvailable

message_buffer.h

size_t xMessageBufferSpaceAvailable( MessageBufferHandle_t xMessageBuffer ) );

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

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.