NetASCII_MAC_to_Str

Convert a Media Access Control (MAC) address into a hexadecimal address string.

Files

net_ascii.h/net_ascii.c

Prototype

          void NetASCII_MAC_to_Str(CPU_INT08U   *p_addr_mac,
                                   CPU_CHAR     *p_addr_mac_ascii,
                                   CPU_BOOLEAN   hex_lower_case,
                                   CPU_BOOLEAN   hex_colon_sep,
                                   NET_ERR      *p_err);

Arguments

p_addr_mac

Pointer to a memory buffer of NET_ASCII_NBR_OCTET_ADDR_MAC bytes in size that contains the MAC address.

p_addr_mac_ascii

Pointer to a memory buffer of size greater than or equal to NET_ASCII_LEN_MAX_ADDR_MAC bytes to receive the MAC address string. Note that the first ASCII character in the string is the most significant nibble of the MAC address’s most significant byte and that the last character in the string is the least significant nibble of the MAC address’s least significant address byte.

Example: “00:1A:07:AC:22:09” = 0x001A07AC2209

hex_lower_case

Select formatting the MAC address string with upper- or lower-case ASCII characters:

DEF_NO

Format MAC address string with upper-case characters

DEF_YES

Format MAC address string with lower-case characters

hex_colon_sep

Select formatting the MAC address string with colon (‘:’) or dash (‘-’) characters to separate the MAC address hexadecimal bytes:

DEF_NO

Separate MAC address bytes with hyphen characters

DEF_YES

Separate MAC address bytes with colon characters

p_err

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

NET_ASCII_ERR_NONE
NET_ASCII_ERR_NULL_PTR

Returned Value

None.

Required Configuration

None.

Notes / Warnings

None.