root / arduino-1.0 / libraries / Ethernet / Ethernet.h @ 58d82c77
History | View | Annotate | Download (1.1 KB)
1 | 58d82c77 | Tom Mullins | #ifndef ethernet_h
|
---|---|---|---|
2 | #define ethernet_h
|
||
3 | |||
4 | #include <inttypes.h> |
||
5 | //#include "w5100.h"
|
||
6 | #include "IPAddress.h" |
||
7 | #include "EthernetClient.h" |
||
8 | #include "EthernetServer.h" |
||
9 | |||
10 | #define MAX_SOCK_NUM 4 |
||
11 | |||
12 | class EthernetClass { |
||
13 | private:
|
||
14 | IPAddress _dnsServerAddress; |
||
15 | public:
|
||
16 | static uint8_t _state[MAX_SOCK_NUM];
|
||
17 | static uint16_t _server_port[MAX_SOCK_NUM];
|
||
18 | // Initialise the Ethernet shield to use the provided MAC address and gain the rest of the
|
||
19 | // configuration through DHCP.
|
||
20 | // Returns 0 if the DHCP configuration failed, and 1 if it succeeded
|
||
21 | int begin(uint8_t *mac_address);
|
||
22 | void begin(uint8_t *mac_address, IPAddress local_ip);
|
||
23 | void begin(uint8_t *mac_address, IPAddress local_ip, IPAddress dns_server);
|
||
24 | void begin(uint8_t *mac_address, IPAddress local_ip, IPAddress dns_server, IPAddress gateway);
|
||
25 | void begin(uint8_t *mac_address, IPAddress local_ip, IPAddress dns_server, IPAddress gateway, IPAddress subnet);
|
||
26 | |||
27 | IPAddress localIP(); |
||
28 | IPAddress subnetMask(); |
||
29 | IPAddress gatewayIP(); |
||
30 | IPAddress dnsServerIP(); |
||
31 | |||
32 | friend class EthernetClient; |
||
33 | friend class EthernetServer; |
||
34 | }; |
||
35 | |||
36 | extern EthernetClass Ethernet;
|
||
37 | |||
38 | #endif |