Embedded TCP/IP stack: fnet_str_to_mac

FNET

fnet_return_t fnet_str_to_mac ( const fnet_char_t str_mac,
fnet_mac_addr_t  addr 
)

Converts a null terminated string to a 6 byte MAC address.

Parameters
[in]str_macNull-terminated MAC address string as pairs of hexadecimal numbers separated by colons.
[out]addrBuffer will contain a suitable binary representation of the str_mac MAC address .
Returns
This function returns:
  • FNET_OK if no error occurs.
  • FNET_ERR if the string in the str_mac parameter does not contain a legitimate MAC address.
See also
fnet_mac_to_str()

This function interprets the character string specified by the str_mac parameter. This string represents a numeric MAC address expressed in six groups of two hexadecimal digits, separated by colons (:), in transmission order. The value returned, pointed to by the addr, is a number suitable for use as an MAC address.


© 2005-2018 by Andrey Butok. http://fnet.sourceforge.net