1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-13 13:01:55 +03:00

prepare lwip2 (#3129)

* minimum changes for libraries to compile with lwip2

* add WiFiClient::availableForWrite() (similar to Serial::) which indicates how much data can be sent without buffering
This commit is contained in:
david gauchard
2017-04-25 15:55:01 +02:00
committed by Ivan Grokhotkov
parent a9224266f3
commit a41f55c469
6 changed files with 51 additions and 4 deletions

View File

@ -36,6 +36,7 @@ extern "C" {
#include "smartconfig.h"
#include "lwip/err.h"
#include "lwip/dns.h"
#include "lwip/init.h" // LWIP_VERSION_
}
#include "debug.h"
@ -400,8 +401,13 @@ IPAddress ESP8266WiFiSTAClass::gatewayIP() {
* @return IPAddress DNS Server IP
*/
IPAddress ESP8266WiFiSTAClass::dnsIP(uint8_t dns_no) {
#if LWIP_VERSION_MAJOR == 1
ip_addr_t dns_ip = dns_getserver(dns_no);
return IPAddress(dns_ip.addr);
#else
const ip_addr_t* dns_ip = dns_getserver(dns_no);
return IPAddress(dns_ip->addr);
#endif
}