CPU_NameSet

Description

Sets the CPU host name.

Files

cpu_core.h/cpu_core.c

Prototype

          void  CPU_NameSet (const  CPU_CHAR  *p_name,
                                    CPU_ERR   *p_err);


Arguments

p_name

Pointer to an ASCII character string with CPU host name to set.

p_err

Pointer to variable that will receive the return error code from this function:

CPU_ERR_NONE
CPU_ERR_NULL_PTR
CPU_ERR_NAME_SIZE

Returned Value

None.

Required Configuration

Available only if CPU_CFG_NAME_EN is DEF_ENABLED in cpu_cfg.h. See Host Name Configuration.

Notes / Warnings

  1. p_name’s ASCII string size, including the terminating NULL character, must be less than or equal to CPU_CFG_NAME_SIZE.

Example Usage

Listing - CPU_NameSet() example usage
          CPU_CHAR  *p_name;
          CPU_ERR    err;
           
           
          p_name = "CPU Host Target";
           
          CPU_NameSet(p_name, &err);    /* Set CPU host name. */
           
          if (err != CPU_ERR_NONE) {
              printf("COULD NOT SET CPU HOST NAME.");
          }