osMailboxPend function
Declaration:
SIZE osMailboxPend(
  HANDLE Handle
  PVOID Buffer,
  SIZE Size
);
Parameters:
Handle

The handle to the mailbox object.

Buffer

A pointer to the buffer that will receive the message data.

Size

The size of the message to be retrieved.

Return value:

Returns the number of bytes successfully transferred, or zero on failure. Call the osGetLastError function to retrieve extended error information.

Description:

This function reads the message from the front of the mailbox and subsequently removes it from the mailbox queue.

If the mailbox is empty and the OS_IPC_WAIT_IF_EMPTY flag was not specified during creation, the function fails immediately. Otherwise, the calling task enters a waiting state until data becomes available. If the task is waiting and direct read-write functionality is enabled (via the OS_IPC_DIRECT_READ_WRITE mode flag), data is transferred directly from the sending task to the waiting task, bypassing the mailbox storage entirely.

For more information regarding mailbox functionality, refer to the mailbox objects section.

This function is available only when both the OS_USE_MAILBOX and OS_MBOX_POST_PEND_FUNC constants are set to 1.

SpaceShadow documentation