/** \brief Initialize the Ethernet subsystem. * */ void init_ethernet(const u8_t macAddress[], const char *hostname) { lwip_init(); ethernet_hardware_init(); ethernetif_set_mac_address(macAddress); netif_set_hostname(&gs_net_if, hostname); }
/** \brief Initialize the Ethernet subsystem. * */ void init_ethernet(const u8_t macAddress[], const char *hostname) { lwip_init(); ethernet_hardware_init(); ethernetif_set_mac_address(macAddress); #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Waddress" /* netif_set_hostname() macro uses an always true conditional * for encapsulation. That, generates a compiler warning which * is why that particular trick isn't always apt. */ netif_set_hostname(&gs_net_if, hostname); #pragma GCC diagnostic pop }
/** \brief Configure the Ethernet subsystem. Should be called after init_ethernet() * */ void ethernet_configure_interface(const u8_t macAddress[], const char *hostname) { ethernetif_set_mac_address(macAddress); netif_set_hostname(&gs_net_if, hostname); }