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

Write data into a queue header.

Description:
This API is used to write the data of the size specified by uwBufferSize and stored at the address specified by pBufferAddr into a queue header.
注意:
  • 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 address of the data of the size specified by uwBufferSize and stored at the address specified by BufferAddr is to be written.
  • The argument uwTimeOut is a relative time.
  • LOS_QueueRead and LOS_QueueWriteHead are a set of interfaces, and the two groups of interfaces need to be used.
参数:
参数名称 描述
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 data to be written. 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 data is successfully written into the queue.
LOS_ERRNO_QUEUE_INVALID  The queue handle passed in during queue writing is invalid.
LOS_ERRNO_QUEUE_WRITE_PTR_NULL  The pointer passed in during queue writing is null.
LOS_ERRNO_QUEUE_WRITESIZE_ISZERO  The buffer size passed in during queue writing is 0.
LOS_ERRNO_QUEUE_WRITE_IN_INTERRUPT  The queue cannot be written during an interrupt when the time for waiting to processing the queue expires.
LOS_ERRNO_QUEUE_NOT_CREATE  The queue into which the data is written is not created.
LOS_ERRNO_QUEUE_WRITE_SIZE_TOO_BIG  The buffer size passed in during queue writing is bigger than the queue size.
LOS_ERRNO_QUEUE_ISFULL  No free node is available during queue writing.
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_QueueWriteHead
自从:
Huawei LiteOS V100R001C00