PxMsgGetData_Hnd()
Get data area of a message (handler service).
- APPLIES TO
-
1.0.0
- SYNOPSIS
-
PxMsgData_t PxMsgGetData_Hnd (PxMsg_t msgid); - ARGUMENTS
|
- ERROR CODES
-
PXERR_MSG_ILLMSGmsgidis not a valid message objectPXERR_MSG_ILLUSERThe calling task is not user of this message
PXERR_PROT_NOFREE_ENTRYNo free protection entry
PXERR_PROT_ILL_HANDLEThe associated protection handle is not valid
PXERR_REQUEST_INVALID_PARAMETERInvalid pair 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 not valid
PXERR_MSG_NOT_IMPLEMENTEDThe function is called by a system interrupt handler
- DESCRIPTION
-
PxMsgGetData_Hndreturns a C-pointer to the data area corresponding to messagemsgid. If an invalid message is given a null pointer is returned.PxMsgGetData_Hndshould only be used from handlers running in a task’s context.
- 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).
-
-
- After call
-
-
PxMsgGetData_Hndreturns a null pointer on failure (C).
-
- Best Practice
-
-
This function should be called from handlers only. (V)
-
- SEE ALSO
- USAGE
-
#include "pxdef.h" PxMsgData_t DataArea = PxMsgGetData_Hnd(msgid) if (DataArea != NULL) { // Handle data } else { // Report error }