PxMsgRelease_Hnd()
Release a message object (handler service).
- APPLIES TO
-
1.0.0
- SYNOPSIS
-
PxMsg_t PxMsgRelease_Hnd (PxMsg_t Msg); - ARGUMENTS
|
- ERROR CODES
-
PXERR_MSG_ILLMSGThe passed message handle is invalid
PXERR_MSG_ILLUSERThe calling task is not the user of the message
PXERR_MBX_ILLMBXThe passed message’s release mailbox handle is invalid
PXERR_MSGREL_NOT_INITEDThe message release server is not yet initialized
PXERR_PROT_ILL_HANDLEThe associated protection handle is not valid
PXERR_REQUEST_INVALID_PARAMETERRequest with invalid parameter
PXERR_ILL_NULLPOINTER_PARAMETERIllegal null pointer parameter in the call
PXERR_PROT_ILL_SIZEThe size of the protection region is not valid
PXERR_PROT_ILL_ALIGNAlignment of protection region is not valid
- DESCRIPTION
-
The
PxMsgRelease_Hndfunction releases the messageMsg. All necessary cleanup operations are performed. For a envelope messages the release service checks if a task is waiting for the message being released. If so, the task is readied.
- IMPLEMENTATION GUIDELINES
-
- Before call
-
-
Msgmust 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).
-
-
- After call
-
-
PxMsgRelease_Hndreturns the message object to the object pool it has been taken from. On successPxMsgRelease_Hndreturns the invalidated message object. This may be checked with one of the following macros:-
PxMsgIdIsValid()must be false. -
PxMsgIdGet()must be_PXIllegalObjId. -
PxMsgIdError()must bePXERR_NOERRORotherwise the returned error code has to be interpreted (C).
-
-
- Best Practice
-
-
After
PxMsgRelease_Hnd, the given message objectMsgis no longer valid and may never be used as message object! -
This function should be called from handlers only. (V)
-
- SEE ALSO
- USAGE
-
#include "pxdef.h" PxMsg_t Msg = PxMsgRelease_Hnd(Msg); if (PxMsgIdIsValid(Msg)) { // Report error }