MSGQ_setSrcQueue
2-264
C Interface
Syntax
MSGQ_setSrcQueue(msg, msgqQueue);
Parameters
MSGQ_MSG
msg;
/* Message */
MSGQ_Queue
msgqQueue; /* Message queue */
Return Value
Void
Reentrant
yes
Description
This API allows the sender to specify a message queue that the receiver
of the message can reply back to (via MSGQ_getSrcQueue). The
msgqQueue must have been returned by MSGQ_open.
Inside each message is a source message queue field. When a message
is allocated, the value of this field is MSGQ_INVALIDMSGQ. When this
API is called, it updates the field accordingly. This API can be called
multiple times on a message.
If a message is sent to another processor, the source message queue
field is managed by the transports accordingly.
Constraints and
Calling Context
❏
Message must have been allocated originally from MSGQ_alloc.
❏
msgqQueue must have been returned from MSGQ_open.
Example
/* Fill in the message */
msg->sequenceNumber = 0;
MSGQ_setSrcQueue((MSGQ_Msg)msg, writerMsgQueue);
/* Send the message */
status = MSGQ_put(readerMsgQueue, (MSGQ_Msg)msg);
if (status != SYS_OK) {
SYS_abort("Failed to send the message");
}
See Also
MSGQ_setSrcQueue
Set the reply destination in a message