1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-07-30 16:24:09 +03:00

Merge branch 'dhcp' of github.com:amcewen/Arduino.

This includes DCHP support and new UDP API for the Ethernet library.
This commit is contained in:
David A. Mellis
2011-03-23 23:28:33 -04:00
parent efae89ea0e
commit f43c0918ff
25 changed files with 1021 additions and 191 deletions

View File

@ -3,6 +3,7 @@
#include <inttypes.h>
//#include "w5100.h"
#include "IPAddress.h"
#include "Client.h"
#include "Server.h"
@ -10,12 +11,23 @@
class EthernetClass {
private:
IPAddress _dnsServerAddress;
public:
static uint8_t _state[MAX_SOCK_NUM];
static uint16_t _server_port[MAX_SOCK_NUM];
void begin(uint8_t *, uint8_t *);
void begin(uint8_t *, uint8_t *, uint8_t *);
void begin(uint8_t *, uint8_t *, uint8_t *, uint8_t *);
// 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;
};