diff options
author | Thibaut VIARD <thibaut.viard@atmel.com> | 2011-06-21 00:20:43 +0200 |
---|---|---|
committer | Thibaut VIARD <thibaut.viard@atmel.com> | 2011-06-21 00:20:43 +0200 |
commit | 0887b98f627500271b5ad8b3c4f6c7b90bc227ee (patch) | |
tree | ef8626954567ba22e392c68c8f3606416b07b5b5 /libraries/Ethernet/Ethernet.h | |
parent | 90c487402cefadb6a2aab907ab07075cbb759e34 (diff) |
Moving all AVR specific libraries to hardware/avr
Diffstat (limited to 'libraries/Ethernet/Ethernet.h')
-rw-r--r-- | libraries/Ethernet/Ethernet.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/libraries/Ethernet/Ethernet.h b/libraries/Ethernet/Ethernet.h new file mode 100644 index 0000000..fdf0b7f --- /dev/null +++ b/libraries/Ethernet/Ethernet.h @@ -0,0 +1,37 @@ +#ifndef ethernet_h +#define ethernet_h + +#include <inttypes.h> +//#include "w5100.h" +#include "IPAddress.h" +#include "Client.h" +#include "Server.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 gateway); + void begin(uint8_t *mac_address, IPAddress local_ip, IPAddress gateway, IPAddress subnet); + + IPAddress localIP(); + IPAddress subnetMask(); + IPAddress gatewayIP(); + IPAddress dnsServerIP(); + + friend class Client; + friend class Server; +}; + +extern EthernetClass Ethernet; + +#endif |