Hostname can now be set

Dependencies:   Socket lwip-eth lwip-sys lwip

Dependents:   GolemTemperaturCheck

Fork of EthernetInterface by mbed official

Revision:
53:3eb289d06391
Parent:
52:f81b90d9a441
--- a/EthernetInterface.h	Fri Apr 29 01:16:12 2016 +0100
+++ b/EthernetInterface.h	Tue May 03 08:29:03 2016 +0000
@@ -34,9 +34,10 @@
 public:
   /** Initialize the interface with DHCP.
   * Initialize the interface and configure it to use DHCP (no connection at this point).
+  * \param hostname the hostname.
   * \return 0 on success, a negative number on failure
   */
-  static int init(); //With DHCP
+  static int init(char* hostname = NULL); //With DHCP
 
   /** Initialize the interface with a static IP address.
   * Initialize the interface and configure it with the following static configuration (no connection at this point).
@@ -45,7 +46,17 @@
   * \param gateway the gateway to use
   * \return 0 on success, a negative number on failure
   */
-  static int init(const char* ip, const char* mask, const char* gateway);
+  //static int init(const char* ip, const char* mask, const char* gateway);
+  
+  /** Initialize the interface with a static IP address.
+  * Initialize the interface and configure it with the following static configuration (no connection at this point).
+  * \param ip the IP address to use
+  * \param mask the IP address mask
+  * \param gateway the gateway to use
+  * \param hostname the hostname of the device
+  * \return 0 on success, a negative number on failure
+  */
+  static int init(const char* ip, const char* mask, const char* gateway, char* hostname = NULL);
 
   /** Connect
   * Bring the interface up, start DHCP if needed.