CPU_NameGet

Description

Gets the CPU host name.

Files

cpu_core.h/cpu_core.c

Prototype

          void  CPU_NameGet (CPU_CHAR  *p_name,
                             CPU_ERR   *p_err);


Arguments

p_name

Pointer to an ASCII character array that will receive the return CPU host name ASCII string from this function.

p_err

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

CPU_ERR_NONE
CPU_ERR_NULL_PTR

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. The size of the ASCII character array that will receive the return CPU host name ASCII string must be greater than or equal to the current CPU host name’s ASCII string size including the terminating NULL character; and should be greater than or equal to CPU_CFG_NAME_SIZE.

Example Usage

Listing - CPU_NameGet() example usage
          CPU_CHAR  *p_name;
          CPU_ERR    err;
           
           
          CPU_NameGet(p_name, &err);    /* Get CPU host name. */
           
          if (err == CPU_ERR_NONE) {
              printf("CPU Host Name = %s", p_name);
          } else {
              printf("COULD NOT GET CPU HOST NAME.");
          }