MSGQ_setMsgId
2-262
C Interface
Syntax
MSGQ_setMsgId(msg, msgId);
Parameters
MSGQ_MSG
msg;
/* Message */
Uint16
msgId;
/* Message id */
Return Value
Void
Reentrant
yes
Description
Inside each message is a message id field. This API sets this field. The
value of msgId is application-specific. MSGQ_getMsgId can be used to
extract this field from a message.
When a message is allocated, the value of this field is
MSGQ_INVALIDMSGID. When MSGQ_setMsgId 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 message Id field is
converted by the transports accordingly (for example, endian conversion
is performed).
The message IDs used when sending messages are application-specific.
They can have any value except values in the following ranges:
❏
Reserved for the MSGQ module messages: 0xFF00 - 0xFF7F
❏
Reserved for internal transport usage: 0xFF80 - 0xFFFE
❏
Used to signify an invalid message ID: 0xFFFF
The following table lists the message IDs currently used by the MSGQ
module.
Constraints and
Calling Context
❏
Message must have been allocated originally from MSGQ_alloc.
MSGQ_setMsgId
Set the message ID in a message
Constant Defined in msgq.h
Value
Description
MSGQ_ASYNCLOCATEMSGID
0xFF00
Used to denote an asynchronous locate message.
MSGQ_ASYNCERRORMSGID
0xFF01
Used to denote an asynchronous transport error.
MSGQ_INVALIDMSGID
0xFFFF
Used as initial value when message is allocated.