PxSysInfoGetOpoolInfo()

Function to get object pool info.

APPLIES TO

1.0.0

SYNOPSIS
PxError_t PxSysInfoGetOpoolInfo (PxInfoOpool_t *OpoolInfo, PxOpool_t OpoolId);
ARGUMENTS
OpoolInfo

Pointer to data area to store object pool information to

OpoolId

Id of object pool object

RETURN VALUES
  • PXROS error code

ERROR CODES

PXERR_OPOOL_ILLOPOOL

The given object is not a mailbox object

PXERR_PROT_PERMISSION

The task has no write permission on the OpoolInfo object

PXERR_GLOBAL_ILLEGAL_CORE

The requested object pool is not on the same core

DESCRIPTION

PxSysInfoGetOpoolInfo stores the object pool OpoolId’s type (real/virtual), its capacity, its minimal capacity, and -if virtual- the superior object pool into the info structure OpoolInfo.

The structure of OpoolInfo has the following format:

// object pool info
typedef struct
{
	PxInfoOpoolType_t PxInfoOpool_Type; // opool’s type
	PxOpool_t  PxInfoOpool_Superior; // real opool, where virtual opools get their objects
	PxULong_t  PxInfoOpool_Capacity; // opool’s capacity
	PxULong_t  PxInfoOpool_MinCapacity; // opool’s lowest capacity
	PxTask_t   PxInfoOpool_RequestingTask; // task, which requested this opool
} PxInfoOpool_t;

The object pool OpoolId may be one of the following types:

typedef enum
{
	OpoolType_Real,
	OpoolType_Virtual
} PxInfoOpoolType_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
  • OpoolInfo must be a pointer to a valid data area.

  • OpoolId must be:

    • a valid PXROS-HR object pool created with a PxOpoolRequest call (V). The validity of OpoolId may also be checked by the PxOpoolIsValid macro (F).

    • the symbolic value PXOpoolSystemdefault specifying the system object pool(V)

    • the symbolic value PXOpoolTaskdefault specifying the task’s object pool(V)

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 = PxSysInfoGetOpoolInfo(&OpoolInfo, opoolId);

if (err == PXERR_NOERROR) {
    // Handle info
}
else {
    // Report error
}