在线时间102 小时
UID166490
注册时间2010-1-5
NXP金币71
该用户从未签到
高级会员

- 积分
- 969
- 最后登录
- 2025-7-8
|
发表于 2014-3-28 16:02:11
|
显示全部楼层
RE:关于 _lwmsgq_receive()函数使用,请各位高手指导。
调用下面函数:
result = _lwmsgq_receive((pointer)server_queue_a, msg_client_a, LWMSGQ_RECEIVE_BLOCK_ON_EMPTY | LWMSGQ_TIMEOUT_FOR, 2,0);
下面是函数参数说明
/*!
* \brief Gets a message from a lightweight message queue.
*
* This function removes the first message from the queue and copies the message
* to the user buffer.
* \n The message becomes a resource of the task.
*
* \param[in] handle Pointer to the message queue created by _lwmsgq_init.
* \param[out] message Received message.
* \param[in] flags LWMSGQ_RECEIVE_BLOCK_ON_EMPTY Block the reading task if msgq is empty.
* LWMSGQ_TIMEOUT_UNTIL Perform a timeout using the tick structure as the absolute time.
* LWMSGQ_TIMEOUT_FOR Perform a timeout using the tick structure as the relative time.
* \param[in] ticks The maximum number of ticks to wait or NULL (unlimited wait).
* \param[in] tick_ptr Pointer to the tick structure to use.
*
* \return MQX_OK
* \return LWMSGQ_INVALID (The handle was not valid.)
* \return LWMSGQ_EMPTY (The LWMSGQ_RECEIVE_BLOCK_ON_EMPTY flag was used and no
* messages were in the message queue.)
* \return LWMSGQ_TIMEOUT (No messages were in the message queue before the timeout
* expired.)
*
* \see _lwmsgq_init
* \see _lwmsgq_usr_check
* \see _lwmsgq_send
* \see MQX_TICK_STRUCT
*/
_mqx_uint _lwmsgq_receive
(
pointer handle,
_mqx_max_type_ptr message,
_mqx_uint flags,
_mqx_uint ticks,
MQX_TICK_STRUCT_PTR tick_ptr
) |
|