jcw/ethercard — pull request #88 by luiscarlosgph (2013-05-20 03:24:48+00:00)
Title: static bool dhcpSetup (const char *) implemented on dhcp.cpp

The static method dhcpSetup (const char *) is defined on EtherCard.h but is has not been implemented on dhcp.cpp

I need to configure the hostname of my Arduino application and I supposed that the already defined method was intended for this purpose.

Therefore:

1) I have created a constant called DHCP_HOSTNAME_MAX_LEN which holds the maximum size of the hostname. I chose a value of 32 for the constant, which seems enough for me.

2) I have used the constant in the definition of the hostname variable:
static char hostname[DHCP_HOSTNAME_MAX_LEN] = "Arduino-00";

3) I have modified the method send_dhcp_message() to adapt it to the variable-length hostname.

4) I have implemented the method dhcpSetup (const char *).