UINT32 LOS_QueueReadCopy ( UINT32  uwQueueID,
VOID *  pBufferAddr,
UINT32 puwBufferSize,
UINT32  uwTimeOut  
)

Read a queue.

Description:
This API is used to read data in a specified queue, and store the obtained data to the address specified by pBufferAddr. The address and the size of the data to be read are defined by users.
注意:
  • 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.
  • 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.
参数:
参数名称 描述
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.
puwBufferSize  [IN/OUT] Where to maintain the buffer wantted-size before read, and the real-size after read.
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.
LOS_ERRNO_QUEUE_READ_SIZE_TOO_SMALL  The buffer size passed in during queue reading is less than the queue size.
Dependency:
  • los_queue.h: the header file that contains the API declaration.
参见:
LOS_QueueWriteCopy | LOS_QueueCreate
自从:
Huawei LiteOS V100R001C00