PxSysInfoGetMsgInfo()

Function to get info about a PXROS message.

APPLIES TO

8.2.0

SYNOPSIS
PxError_t PxSysInfoGetMsgInfo (PxInfoMsg_t *MsgInfo, PxMsg_t msgId);
ARGUMENTS
MsgInfo

Pointer to the data area to store information to

msgId

Id of message object

RETURN VALUES
  • PXROS error code

ERROR CODES

PXERR_MSG_ILLMSG

The given object is not a message object

PXERR_PROT_PERMISSION

The task has no write permission on the MsgInfo object

PXERR_GLOBAL_ILLEGAL_CORE

The requested object pool is not on the same core

DESCRIPTION

PxSysInfoGetMsgInfo stores the owner, user, and pointer to message data, message size, message buffer size, and message type of the message object msgId into the info structure MsgInfo.

The structure MsgInfo has 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 msgId may 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 sysinfo types:

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
  • MsgInfo must be a pointer to a valid data area.

  • msgid must be a valid message object, requested via PxMsgRequest…​ or PxMsgEnvelop…​ or received by a PxMsgReceive…​ call (V). This id may be checked with one of the following macros:

    • PxMsgIdIsValid() must be true.

    • PxMsgIdGet() must not be _PXIllegalObjId.

    • PxMsgIdError() must be PXERR_NOERROR otherwise the returned error code has to be interpreted (C).

After call
  • The function returns PXERR_NOERROR if 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
}