PxMsgSetData()
Set message data pointer.
- APPLIES TO
-
8.2.0
- SYNOPSIS
-
PxError_t PxMsgSetData (PxMsg_t msgid, PxMsgData_t new_data); - ARGUMENTS
|
|
|
- RETURN VALUES
-
-
PXROS error code
-
- ERROR CODES
-
PXERR_MSG_ILLMSGThe passed message handle is invalid
PXERR_MSG_ILLOWNERThe calling task is not the owner of the message
PXERR_MSG_ILLUSERThe calling task is not the user of the message
PXERR_MSG_ILL_NEW_DATAThe new data pointer not within the corresponding data area
- DESCRIPTION
-
PxMsgSetDatasets the data pointer of messagemsgidto new_data. The calling task must be the user ofmsgid. new_data must be part of the messages data area. If new_data is NULL, the message’s data pointer is reset to the start of the data area. In this case the calling task must be the owner ofmsgid.
- 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).
-
-
new_datamust be a pointer to an address within the message’s original data buffer (V).
-
- After call
-
-
The function returns
PXERR_NOERRORif the message’s data area is changed. Any other return value describes an error, which has to be interpreted (C).
-
- Best Practice
-
-
No restrictions.
-
- SEE ALSO
- USAGE
-
#include "pxdef.h" PxError_t Err = PxMsgSetData(msgid, (PxMsgData_t) 0); if (Err != PXERR_NOERROR) { // Report error }