aboutsummaryrefslogtreecommitdiff
path: root/libraries/Ethernet/Ethernet.h
diff options
context:
space:
mode:
authorCristian Maglie <c.maglie@bug.st>2012-01-04 15:14:51 +0100
committerCristian Maglie <c.maglie@bug.st>2012-01-04 15:14:51 +0100
commit8c2b5b979a75d109ae7cc306afc50d7ffe1e0366 (patch)
tree19ac8d91c7209397e7dc890b432a254ae9a7cd62 /libraries/Ethernet/Ethernet.h
parentbe52c95820400d48e47615232d3c38236166fad3 (diff)
Moved libraries folder inside platform folder. Now libraries and examples are searched per board/platform
Diffstat (limited to 'libraries/Ethernet/Ethernet.h')
-rw-r--r--libraries/Ethernet/Ethernet.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/libraries/Ethernet/Ethernet.h b/libraries/Ethernet/Ethernet.h
new file mode 100644
index 0000000..c916dda
--- /dev/null
+++ b/libraries/Ethernet/Ethernet.h
@@ -0,0 +1,38 @@
+#ifndef ethernet_h
+#define ethernet_h
+
+#include <inttypes.h>
+//#include "w5100.h"
+#include "IPAddress.h"
+#include "EthernetClient.h"
+#include "EthernetServer.h"
+
+#define MAX_SOCK_NUM 4
+
+class EthernetClass {
+private:
+ IPAddress _dnsServerAddress;
+public:
+ static uint8_t _state[MAX_SOCK_NUM];
+ static uint16_t _server_port[MAX_SOCK_NUM];
+ // Initialise the Ethernet shield to use the provided MAC address and gain the rest of the
+ // configuration through DHCP.
+ // Returns 0 if the DHCP configuration failed, and 1 if it succeeded
+ int begin(uint8_t *mac_address);
+ void begin(uint8_t *mac_address, IPAddress local_ip);
+ void begin(uint8_t *mac_address, IPAddress local_ip, IPAddress dns_server);
+ void begin(uint8_t *mac_address, IPAddress local_ip, IPAddress dns_server, IPAddress gateway);
+ void begin(uint8_t *mac_address, IPAddress local_ip, IPAddress dns_server, IPAddress gateway, IPAddress subnet);
+
+ IPAddress localIP();
+ IPAddress subnetMask();
+ IPAddress gatewayIP();
+ IPAddress dnsServerIP();
+
+ friend class EthernetClient;
+ friend class EthernetServer;
+};
+
+extern EthernetClass Ethernet;
+
+#endif