PxTaskGetName()

Return the name of a task.

APPLIES TO

8.2.0

SYNOPSIS
PxError_t PxTaskGetName(PxTask_t task, PxChar_t *buffer, PxUInt_t bufsize);
ARGUMENTS
task

Task Id

buffer

Data area to copy the task’s name to

bufsize

Size of data area

RETURN VALUES
  • PXROS error code

ERROR CODES

PXERR_NAME_BUFOVERFLOW

data area is too short to store the task’s name

PXERR_OBJ_ILLOBJ

task is not a valid task id

PXERR_PROT_PERMISSION

data area is not writeable for the calling task

DESCRIPTION

PxTaskGetName copies the name of task into the buffer buffer of length bufsize. The result is zero-terminated.

IMPLEMENTATION GUIDELINES
Before call
  • The parameter task 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).

  • buffer should point to a valid memory area, where the task’s name is stored.

  • bufsize should be a constant or a sizeof() operator (V).

After call
  • The function returns PXERR_NOERROR if the task’s name could be stored. Any other return value describes an error, which has to be interpreted (C).

Best Practice
  • No restrictions.

SEE ALSO
USAGE
#include "pxdef.h"

if (PxTaskGetName(task, buffer, bufsize) == Err)
{
    // Report error
}