PxMsgSetMetadata()

Set the metadata for the message.

APPLIES TO

8.2.0

SYNOPSIS
PxError_t PxMsgSetMetadata (PxMsg_t msgid, PxMsgMetadata_t metadata);
ARGUMENTS
msgid

The message object

metadata

The metadata

ERROR CODES

PXERR_MSG_ILLMSG

msgid is not a valid message object

PXERR_MSG_ILLUSER

calling task is not user of this message

PXERR_MSG_NOT_IMPLEMENTED

The function is called by a system interrupt handler

DESCRIPTION

PxMsgSetMetadata sets the metadata for the message. The size of the metadata is 8 byte. It should only be called from tasks (not from handlers).

IMPLEMENTATION GUIDELINES
Before call
  • msgid must be a valid message object, requested via PxMsgRequest…​ or PxMsgEnvelop…​ or received by a PxMsgReceive…​ call (V). This message object 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 message’s metadata is set. 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 = PxMsgSetMetadata(msgid, metadata);

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