** Message Queue
msgQLib - message queue library
ROUTINES
msgQCreate( ) - create and initialize a message queue
msgQDelete( ) - delete a message queue
msgQSend( ) - send a message to a message queue
msgQReceive( ) - receive a message from a message queue
msgQNumMsgs( ) - get the number of messages queued to a message queue
DESCRIPTION
This library contains routines for creating and using message queues, the primary intertask communication mechanism within a single CPU. Message queues allow a variable number of messages (varying in length) to be queued in first-in-first-out (FIFO) order. Any task or interrupt service routine can send messages to a message queue. Any task can receive messages from a message queue. Multiple tasks can send to and receive from the same message queue. Full-duplex communication between two tasks generally requires two message queues, one for each direction.
To provide message queue support for a system, VxWorks must be configured with the INCLUDE_MSG_Q component.
msgQCreate( ) - create and initialize a message queue
MSG_Q_ID msgQCreate
(
int maxMsgs, /* max messages that can be queued */
int maxMsgLength, /* max bytes in a message */
int options /* message queue options */
)
msgQDelete( ) - delete a message queue
STATUS msgQDelete
(
MSG_Q_ID msgQId /* message queue to delete */
)
msgQSend( ) - send a message to a message queue
STATUS msgQSend
(
MSG_Q_ID msgQId, /* message queue on which to send */
char * buffer, /* message to send */
UINT nBytes, /* length of message */
int timeout, /* ticks to wait */
int priority /* MSG_PRI_NORMAL or MSG_PRI_URGENT */
)
msgQReceive( ) - receive a message from a message queue
int msgQReceive
(
MSG_Q_ID msgQId, /* message queue from which to receive */
char * buffer, /* buffer to receive message */
UINT maxNBytes, /* length of buffer */
int timeout /* ticks to wait */
)
msgQNumMsgs( ) - get the number of messages queued to a message queue
int msgQNumMsgs
(
MSG_Q_ID msgQId /* message queue to examine */
)