MSGQ_open
2-254
C Interface
Syntax
status = MSGQ_open(queueName, msgqQueue, attrs);
Parameters
String
queueName; /* Unique name of the message queue */
MSGQ_Queue *msgqQueue; /* Pointer to returned message queue */
MSGQ_Attrs
*attrs;
/* Attributes of the message queue */
Return Value
Int
status;
/* status */
Reentrant
yes
Description
MSGQ_open is the function to open a message queue. This function
selects and returns a message queue from the array provided in the static
configuration (that is, MSGQ_config->msgqQueues).
This function is on the processor where the reader resides. The reader
then uses this message queue to receive messages.
If successful, this function returns SYS_OK. Otherwise, it returns
SYS_ENOTFOUND to indicate that no empty spot was available in the
message queue array.
If the application will use MSGQ_locate or MSGQ_locateAsync to find
this message queue, the queueName must be unique. If the application
will never need to use the locate APIs, the queueName may be NULL or
a non-unique name.
Instead of using a fixed notification mechanism, such as SEM_pend and
SEM_post, the MSGQ notification mechanism is supplied in the attrs
parameter, which is of type MSGQ_Attrs. If attrs is NULL, the new
message queue is assigned a default set of attributes. The structure for
MSGQ_Attrs is as follows:
typedef struct MSGQ_Attrs {
Ptr notifyHandle;
MSGQ_Pend pend;
MSGQ_Post post;
} MSGQ_Attrs;
The MSGQ_Attrs fields are as follows:
MSGQ_open
Open a message queue
Field
Type
Description
notifyHandle
Ptr
Handle to use in the pend() and post() functions.