PxSysInfoGetMsgInfo()
Function to get info about a PXROS message.
- APPLIES TO
-
1.0.0
- SYNOPSIS
-
PxError_t PxSysInfoGetMsgInfo (PxInfoMsg_t *MsgInfo, PxMsg_t msgId); - ARGUMENTS
|
|
|
- RETURN VALUES
-
-
PXROS error code
-
- ERROR CODES
-
PXERR_MSG_ILLMSGThe given object is not a message object
PXERR_PROT_PERMISSIONThe task has no write permission on the
MsgInfoobjectPXERR_GLOBAL_ILLEGAL_COREThe requested object pool is not on the same core
- DESCRIPTION
-
PxSysInfoGetMsgInfostores the owner, user, and pointer to message data, message size, message buffer size, and message type of the message objectmsgIdinto the info structureMsgInfo.The structure
MsgInfohas the following format:typedef struct { PxInfoMsgType_t PxInfoMsg_Type; // message type PxTask_t PxInfoMsg_Owner; // message owner PxTask_t PxInfoMsg_User; // message user PxMbx_t PxInfoMsg_Mbx; // mailbox, where message lies PxUChar_t *PxInfoMsg_Data; // message data area PxULong_t PxInfoMsg_Size; // actual size of data area PxULong_t PxInfoMsg_BufSize; // size of requested data area PxTask_t PxInfoMsg_RequestingTask; // task, which has requested the message PxMbx_t PxInfoMsg_RelMbx; // message's release mailbox } PxInfoMsg_t;The message
msgIdmay have one of the following types:// Message type typedef enum { MsgType_Unknown, // unknown type MsgType_Enveloped, // requested via PxMsgEnvelop MsgType_Requested // requested via PxMsgRequest } PxInfoMsgType_t;There is a union available containing all
sysinfotypes:typedef union { PxInfoMC_t McInfo; // memory class information struct PxInfoOpool_t OpoolInfo; // Opool information struct PxInfoMsg_t MsgInfo; // message information struct PxInfoMbx_t MbxInfo; // mailbox information struct PxInfoDelay_t DelayInfo; // delay object information struct PxInfoPe_t PeInfo; // periodic event information struct PxInfoTo_t ToInfo; // timeout object information struct PxInfoInterrupt_t InterruptInfo; // interrupt object information struct } PxObjInfo_T;
- IMPLEMENTATION GUIDELINES
-
- Before call
-
-
MsgInfomust be a pointer to a valid data area. -
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
-
-
The function returns
PXERR_NOERRORif the system information could be delivered. 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 = PxSysInfoGetMsgInfo(&MsgInfo, msgId); if (err == PXERR_NOERROR) { // Handle info } else { // Report error }