PxMsgInstallRelmbx()
Install a mailbox as a release mailbox.
- APPLIES TO
-
1.0.0
- SYNOPSIS
-
PxError_t PxMsgInstallRelmbx (PxMsg_t msgid, PxMbx_t mbxid); - ARGUMENTS
|
|
|
- RETURN VALUES
-
-
PXROS error code
-
- ERROR CODES
-
PXERR_MBX_ILLMBXThe passed mailbox handle is invalid
PXERR_MSG_ILLMSGThe passed message handle is invalid
PXERR_MSG_ILLUSERThe calling task is not the user of the message
PXERR_MSG_NOT_IMPLEMENTEDThe message has not been requested
PXERR_MSG_RELMBX_INSTALLEDA release mailbox is already installed for the message
- DESCRIPTION
-
PxMsgInstallRelmbxinstallsmbxidas release mailbox formsgid, ifmbxidis a valid mailbox object; ifmbxidis an illegal object a potential release mailbox formsgidis de-installed. To use this service, the calling task must be the user ofmsgid.If a release mailbox
mbxidis installed atmsgidandmsgidis later released,msgidis not destroyed but sent tombxid.
- IMPLEMENTATION GUIDELINES
-
- Before call
-
-
msgidmust be a valid message object, requested viaPxMsgRequest…orPxMsgEnvelop…or received by aPxMsgReceive…call (V). This id may be checked with one of the following macros:-
PxMsgIdIsValid()must be true. -
PxMsgIdGet()must not be_PXIllegalObjId. -
PxMsgIdError()must bePXERR_NOERRORotherwise the returned error code has to be interpreted (C).
-
-
The parameter
mbxidmust be a valid mailbox object id. This id may be-
the calling task’s own mailbox (V)
-
the return value of a
PxTaskGetMbx()call (V) -
the result of a
nameserverquery (V) -
part of a message sent by another task (V)
-
-
The mailbox may be checked with the macros
-
PxMsgIdIsValid()must be true. -
PxMsgIdGet()must not be_PXIllegalObjId. -
PxMsgIdError()must bePXERR_NOERRORotherwise the returned error code has to be interpreted (C).
-
-
or with a call of
PxMbxCheck()(C). -
The mailbox
mbxidmust be created on the same core as the caller runs on. The creator core id can be read with the macroPxMbxCoreIdand the own core id withPxGetCoreId(C).
-
- After call
-
-
The function returns
PXERR_NOERRORif the mailbox is registered as release mailbox for the appropriate message. Any other return value describes an error, which has to be interpreted (C).
-
- Best Practice
-
-
This function typically is used to create so called "message pools". These message pools should be created during initialization to ensure their availability.
-
- SEE ALSO
- USAGE
-
#include "pxdef.h" PxError_t Err = PxMsgInstallRelmbx(msgid, mbxid); if (Err != PXERR_NOERROR) { // Report error }