Chapter 2. API Reference
xMessageBufferNextLengthBytes(xMessageBuffer)
Returns the length (in bytes) of the next message in a message buffer. Useful if xMessageBufferReceive()
returned 0 because the size of the buffer passed into xMessageBufferReceive() was too small to hold the next
message.
Return The length (in bytes) of the next message in the message buffer, or 0 if the message buffer is empty.
Parameters
• xMessageBuffer: The handle of the message buffer being queried.
xMessageBufferSendCompletedFromISR(xMessageBuffer, pxHigherPriorityTaskWoken)
For advanced users only.
The sbSEND_COMPLETED() macro is called from within the FreeRTOS APIs when data is sent to a message
buffer or stream buffer. If there was a task that was blocked on the message or stream buffer waiting for data to
arrive then the sbSEND_COMPLETED() macro sends a notification to the task to remove it from the Blocked
state. xMessageBufferSendCompletedFromISR() does the same thing. It is provided to enable application
writers to implement their own version of sbSEND_COMPLETED(), and MUST NOT BE USED AT ANY
OTHER TIME.
See the example implemented in FreeRTOS/Demo/Minimal/MessageBufferAMP.c for additional information.
Return If a task was removed from the Blocked state then pdTRUE is returned. Otherwise pdFALSE is
returned.
Parameters
• xMessageBuffer: The handle of the stream buffer to which data was written.
• pxHigherPriorityTaskWoken: *pxHigherPriorityTaskWoken should be initialised to
pdFALSE before it is passed into xMessageBufferSendCompletedFromISR(). If calling xMessage-
BufferSendCompletedFromISR() removes a task from the Blocked state, and the task has a priority
above the priority of the currently running task, then *pxHigherPriorityTaskWoken will get set to
pdTRUE indicating that a context switch should be performed before exiting the ISR.
xMessageBufferReceiveCompletedFromISR(xMessageBuffer, pxHigherPriorityTaskWoken)
For advanced users only.
The sbRECEIVE_COMPLETED() macro is called from within the FreeRTOS APIs when data is read out of
a message buffer or stream buffer. If there was a task that was blocked on the message or stream buffer waiting
for data to arrive then the sbRECEIVE_COMPLETED() macro sends a notification to the task to remove it
from the Blocked state. xMessageBufferReceiveCompletedFromISR() does the same thing. It is provided to
enable application writers to implement their own version of sbRECEIVE_COMPLETED(), and MUST NOT
BE USED AT ANY OTHER TIME.
See the example implemented in FreeRTOS/Demo/Minimal/MessageBufferAMP.c for additional information.
Return If a task was removed from the Blocked state then pdTRUE is returned. Otherwise pdFALSE is
returned.
Parameters
• xMessageBuffer: The handle of the stream buffer from which data was read.
• pxHigherPriorityTaskWoken: *pxHigherPriorityTaskWoken should be initialised to
pdFALSE before it is passed into xMessageBufferReceiveCompletedFromISR(). If calling xMes-
sageBufferReceiveCompletedFromISR() removes a task from the Blocked state, and the task has a
priority above the priority of the currently running task, then *pxHigherPriorityTaskWoken will get
set to pdTRUE indicating that a context switch should be performed before exiting the ISR.
Type Definitions
typedef void *MessageBufferHandle_t
Type by which message buffers are referenced. For example, a call to xMessageBufferCreate() returns an
MessageBufferHandle_t variable that can then be used as a parameter to xMessageBufferSend(), xMessage-
BufferReceive(), etc.
Espressif Systems 954
Submit Document Feedback
Release v4.4