PxTaskGetMbx()

Get task’s mailbox.

APPLIES TO

1.0.0

SYNOPSIS
PxMbx_t PxTaskGetMbx (PxTask_t TaskId);
ARGUMENTS
TaskId

Task whose mailbox is asked for

RETURN VALUES
  • Invalid mailbox handle on failure

  • Mailbox on success

ERROR CODES

PXERR_TASK_ILLTASK

The task is not a valid task object

DESCRIPTION

PxTaskGetMbx returns the private mailbox of the task TaskId.

IMPLEMENTATION GUIDELINES
Before call
  • The parameter TaskId must be a valid task object id. This id may be

    • the calling task’s own id read by calling PxGetId() (V)

    • the return value of a PxTaskCreate() call (V)

    • the result of a nameserver query (V)

    • part of a message sent by another task (V)

  • Additionally the task id may be checked with PxTaskCheck() (F).

After call
  • The returned value is the id of type PxMbx_t. This id may be checked with one of the following macros:

    • PxMbxIdIsValid() must be true.

    • PxMbxIdGet() must not be _PXIllegalObjId.

    • PxMbxIdError() must be PXERR_NOERROR otherwise the returned error code has to be interpreted (C).

or with a call of PxMbxCheck() (C).

Best Practice
  • No restrictions.

SEE ALSO
USAGE
#include "pxdef.h"

PxMbx_t Mbx = PxTaskGetMbx(TaskId);

if (!PxMbxIdIsValid(Mbx)) {
    // Report error
}