PxMsgSend()
Send normal message (task service).
- APPLIES TO
-
1.0.0
- SYNOPSIS
-
PxMsg_t PxMsgSend (PxMsg_t msg, PxMbx_t mbx); - ARGUMENTS
|
|
|
- RETURN VALUES
-
-
Invalid message handle on success
-
Msgincluding PXROS error code on failure
-
- ERROR CODES
-
PXERR_MBX_ILLMBXThe mailbox handle is invalid
PXERR_MSG_ILLMSGThe message handle is invalid
PXERR_MSG_ILLUSERThe sending task is not user of the message
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
PXERR_TASK_ILLTASKThe task is not a valid task object
- DESCRIPTION
-
The
PxMsgSendfunction sends the messagemsginto the mailboxmbxid. The calling task must be the user ofmsg. After the message is sent, it does not have a user (temporarily).
- 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).
-
-
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
-
PxMbxIdIsValid()must be true. -
PxMbxIdGet()must not be_PXIllegalObjId. -
PxMbxIdError()must bePXERR_NOERRORotherwise the returned error code has to be interpreted (C).
-
-
or with a call of
PxMbxCheck()(C).
-
- After call
-
-
On success
PxMsgSendreturns 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
-
-
No restrictions.
-
- SEE ALSO
- USAGE
-
#include "pxdef.h" PxMsg_t Msg = PxMsgSend(msg, mbx); if ((PxMsgIdError(Msg) != PXERR_NOERROR) || PxMsgIdIsValid(Msg)) { // Report error }