PxTraceGetBuffer()

Return a message object containing the trace buffer.

APPLIES TO

8.2.0

SYNOPSIS
PxMsg_t PxTraceGetBuffer (PxOpool_t OpoolId);
ARGUMENTS
OpoolId

Objectpool to get the message object from

ERROR CODES

PXERR_OPOOL_ILLOPOOL

Illegal opool passed

PXERR_GLOBAL_ILLEGAL_CORE

The requested object pool is not on the same core

PXERR_OBJ_ABORTED

The request was aborted by an event

PXERR_OBJ_ILLOBJ

The passed object handle is not valid

PXERR_OBJ_NOOBJ

No free object is available

PXERR_MSG_ILLMSG

The passed message handle is invalid

PXERR_SERVICE_NOT_CONFIGURED

Service has not been configured into your PXROS

PXERR_INTERNAL_INCONSISTENCY

Inconsistency of internal structures

DESCRIPTION

PxTraceGetBuffer returns a message containing the circular buffer of the PXROS trace mechanism.

IMPLEMENTATION GUIDELINES
Before call
  • OpoolId must be a valid PXROS-HR object pool and the calling task must have the access right to take objects from this object pool (V). The validity of OpoolId may also be checked by the PxOpoolIsValid macro (F). The object pool must be created on the same core as the caller runs on. The creator core id can be read with the macro PxOpoolCoreId and the own core id with PxGetCoreId (C). Typically the task’s default object pool PXOpoolTaskdefault is used for this purpose.

After call
  • The returned value is the id of type PxMsg_t. 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).

Best Practice
  • No restrictions

USAGE
#include "pxdef.h"

PxMsg_t Msg = PxTraceGetBuffer(opoolId);

if (PxMsgIdError(Msg) != PXERR_NOERROR) {
    // Report error
}