PxMsgGetName()

Return the name of a message object.

APPLIES TO

8.2.0

SYNOPSIS
PxError_t PxMsgGetName (PxMsg_t msg, PxChar_t *buffer, PxUInt_t bufsize);
ARGUMENTS
msg

The message object whose name will be returned

buffer

Pointer to data area to copy the object’s name to

bufsize

Size of data area

RETURN VALUES
  • PXROS error code

ERROR CODES

PXERR_NAME_BUFOVERFLOW

The data area is too short to store the object’s name

PXERR_PROT_PERMISSION

The data area is not writeable for the calling task

PXERR_SERVICE_NOT_CONFIGURED

Service has not been configured

PXERR_OBJ_ILLOBJ

The passed message handle is not valid

PXERR_GLOBAL_ILLEGAL_CORE

The message object is not on the same core

DESCRIPTION

PxMsgGetName retrieves the name of the message object msg by copying characters into the buffer of length bufsize. The result is null-terminated.

SEE ALSO
USAGE
#include "pxdef.h"

const char msgName[13] = "MESSAGE-NAME"; // 12 characters + null character

PxError_t err = PxMsgSetName(msg, msgName, 13);

if (err != PXERR_NOERROR) {
    // Report error
}

char retMsgName[13];

PxError_t err = PxMsgGetName(msg, msgName, 13);

if (err != PXERR_NOERROR) {
    // Report error
}