NetASCII_Str_to_MAC

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

Files

net_ascii.h/net_ascii.c

Prototype

          void NetASCII_Str_to_MAC(CPU_CHAR    *p_addr_mac_ascii,
                                   CPU_INT08U  *p_addr_mac,
                                   NET_ERR     *p_err);

Arguments

p_addr_mac_ascii

Pointer to an ASCII string that contains hexadecimal bytes separated by colons or dashes that represents the MAC address. Each hexadecimal byte of the MAC address string must be separated by either the colon (‘:’) or dash (‘-’) characters. 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

p_addr_mac

Pointer to a memory buffer of size greater than or equal to NET_ASCII_NBR_OCTET_ADDR_MAC bytes to receive the MAC address.

p_err

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

NET_ASCII_ERR_NONE
NET_ASCII_ERR_NULL_PTR
NET_ASCII_ERR_INVALID_STR_LEN
NET_ASCII_ERR_INVALID_CHAR
NET_ASCII_ERR_INVALID_CHAR_LEN
NET_ASCII_ERR_INVALID_CHAR_SEQ

Returned Value

None.

Required Configuration

None.

Notes / Warnings

None.