PxSysInfoGetToInfo()

Function to get To info.

APPLIES TO

8.2.0

SYNOPSIS
PxError_t PxSysInfoGetToInfo (PxInfoTo_t *ToInfo, PxTo_t toId);
ARGUMENTS
ToInfo

Pointer to data area to store timeout object information to

toId

Id of timeout object

RETURN VALUES
  • PXROS error code

ERROR CODES

PXERR_PROT_PERMISSION

The task has no write permission on the ToInfo object

PXERR_TO_ILLTO

The given object is no timeout object

DESCRIPTION

PxSysInfoGetToInfo stores the contents of the timout handler toId into the info structure ToInfo.

The structure ToInfo has the following format:

typedef struct
{
	PxTask_t PxInfoTo_Task; // task to receive timeout event
	PxEvents_t  PxInfoTo_Event; // timeout event
	PxULong_t  PxInfoTo_Timeout; // timeout period
	PxULong_t  PxInfoTo_RestTicks; // rest ticks
	PxTask_t   PxInfoTo_RequestingTask; // task which requested the to object
} PxInfoTo_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
  • ToInfo must be a pointer to a valid data area.

  • toId must be a valid PXROS-HR timeout handler object created with a PxToRequest call (V). The validity of toId may also be checked by the PxToIsValid macro (F).

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 = PxSysInfoGetToInfo(&ToInfo, toId);

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