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_ILLMSG
The passed message handle is invalid
PXERR_MSG_ILLOWNER
The calling task is not the owner of the message
PXERR_MSG_ILLUSER
The calling task is not the user of the message
PXERR_MSG_ILL_NEW_DATA
The new data pointer not within the corresponding data area
- DESCRIPTION
-
PxMsgSetData sets the data pointer of message msgid to new_data. The calling task must be the user of msgid. 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 of msgid.
- IMPLEMENTATION GUIDELINES
-
- Before call
-
-
msgid
must 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_NOERROR
otherwise the returned error code has to be interpreted (C).
-
-
new_data
must be a pointer to an address within the message’s orignial data buffer (V).
-
- After call
-
-
The function returns
PXERR_NOERROR
if 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 }