1.1.1.2.7 OSAL_QUEUE_Receive Function

C

OSAL_RESULT OSAL_QUEUE_Receive(OSAL_QUEUE_HANDLE_TYPE *queID, void  *pBuffer, uint16_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

ParamDescription
queIDA pointer to the queue ID
bufferA 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.
waitMSTime limit to wait in milliseconds.
0do not wait
OSAL_WAIT_FOREVERreturn only when semaphore is obtained
Other valuestimeout 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