OSAL_QUEUE_Receive Function

C

OSAL_RESULT OSAL_QUEUE_Receive(OSAL_QUEUE_HANDLE_TYPE *queID, void  *pBuffer, uint32_t waitMS);

Description

Receive an item from an OSAL Queue. The item is received by copy so a buffer of adequate size must be provided. The number of bytes copied into the buffer was defined when the queue was created. Successfully received items are removed from the queue. This function must not be used in an interrupt service routine.

Parameters

Param Description
queID A pointer to the queue ID
buffer A pointer to the buffer into which the received item will be copied. The size of the items the queue hold was defined when the queue was created, so this many bytes will be copied from the queue storage area into the buffer.
waitMS Time limit to wait in milliseconds.
0 do not wait
OSAL_WAIT_FOREVER return only when semaphore is obtained
Other values timeout delay

Returns

OSAL_RESULT_TRUE - An item was successfully received from the queue

OSAL_RESULT_FALSE - An item was not successfully received from the queue or timeout occurred