UINT32 LOS_QueueRead ( UINT32  uwQueueID,
VOID *  pBufferAddr,
UINT32  uwBufferSize,
UINT32  uwTimeOut  
)

Read a queue.

Description:
This API is used to read the address of data in a specified queue, and store it to the address specified by pBufferAddr.
注意:
  • The specific queue should be created firstly.
  • Queue reading adopts the fist in first out (FIFO) mode. The data that is first stored in the queue is read first.
  • pBufferAddr stores the obtained data address.
  • Do not read or write a queue in unblocking modes such as an interrupt.
  • This API cannot be called before the Huawei LiteOS is initialized.
  • The argument uwTimeOut is a relative time.
  • The uwBufferSize is not really used in LOS_QueueRead, because the interface is only used to obtain the address of data.
  • The buffer which the pBufferAddr pointing to must be greater than or equal to 4 bytes.
参数:
参数名称 描述
uwQueueID  [IN] Queue ID created by LOS_QueueCreate. The value range is [1,LOSCFG_BASE_IPC_QUEUE_LIMIT].
pBufferAddr  [OUT] Starting address that stores the obtained data. The starting address must not be null.
uwBufferSize  [IN] Passed-in buffer size, which must not be 0. The value range is [1,0xffffffff].
uwTimeOut  [IN] Expiry time. The value range is [0,LOS_WAIT_FOREVER](unit: Tick).
返回值:
返回值 描述
LOS_OK  The queue is successfully read.
LOS_ERRNO_QUEUE_INVALID  The handle of the queue that is being read is invalid.
LOS_ERRNO_QUEUE_READ_PTR_NULL  The pointer passed in during queue reading is null.
LOS_ERRNO_QUEUE_READSIZE_ISZERO  The buffer size passed in during queue reading is 0.
LOS_ERRNO_QUEUE_READ_IN_INTERRUPT  The queue cannot be read during an interrupt when the time for waiting to processing the queue expires.
LOS_ERRNO_QUEUE_NOT_CREATE  The queue to be read is not created.
LOS_ERRNO_QUEUE_ISEMPTY  No resource is in the queue that is being read when the time for waiting to processing the queue expires.
LOS_ERRNO_QUEUE_PEND_IN_LOCK  The task is forbidden to be blocked on a queue when the task is locked.
LOS_ERRNO_QUEUE_TIMEOUT  The time set for waiting to processing the queue expires.
Dependency:
  • los_queue.h: The header file that contains the API declaration.
参见:
LOS_QueueWrite | LOS_QueueCreate
自从:
Huawei LiteOS V100R001C00