PxMsgSetSize()

Set message size.

APPLIES TO

1.0.0

SYNOPSIS
PxError_t PxMsgSetSize (PxMsg_t msgid, PxSize_t size);
ARGUMENTS
msgid

Message object for which the size is set

size

New message size

RETURN VALUES
  • PXROS error code

ERROR CODES

PXERR_MSG_ILLMSG

The passed message handle is invalid

PXERR_MSG_ILLSIZE

size exceeds the size of the corresponding data area

PXERR_MSG_ILLUSER

The calling task is not the user of the message

DESCRIPTION

PxMsgSetSize sets the size of message msgid to size (specified in byte units). The calling task must be the user of msgid.

IMPLEMENTATION GUIDELINES
Before call
  • msgid must be a valid message object, requested via PxMsgRequest…​ or PxMsgEnvelop…​ or received by a PxMsgReceive…​ call (V). 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).

  • size must have a plausible value (V).

After call
  • The function returns PXERR_NOERROR if the message’s size is changed. 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 = PxMsgSetSize(msgid, 10);

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