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

Adding Ethernet.maintain() to update DHCP leases (Peter Magnusson)

returns:
    0: nothing happened
    1: renew failed
    2: renew success
    3: rebind fail
    4: rebind success

http://code.google.com/p/arduino/issues/detail?id=716
This commit is contained in:
David A. Mellis
2012-03-02 18:51:48 -05:00
parent a6eb9ea5eb
commit 9f3438c189
4 changed files with 193 additions and 25 deletions

View File

@ -6,12 +6,14 @@
#include "IPAddress.h"
#include "EthernetClient.h"
#include "EthernetServer.h"
#include "Dhcp.h"
#define MAX_SOCK_NUM 4
class EthernetClass {
private:
IPAddress _dnsServerAddress;
DhcpClass* _dhcp;
public:
static uint8_t _state[MAX_SOCK_NUM];
static uint16_t _server_port[MAX_SOCK_NUM];
@ -23,6 +25,7 @@ public:
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);
int maintain();
IPAddress localIP();
IPAddress subnetMask();