1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-16 11:21:18 +03:00

Added broadcastIP method to WiFiSTA class (#7899)

This commit is contained in:
Drzony
2021-03-16 16:01:04 +01:00
committed by GitHub
parent 2406fe8fb8
commit 1b922edad1
2 changed files with 13 additions and 0 deletions

View File

@ -504,6 +504,18 @@ IPAddress ESP8266WiFiSTAClass::dnsIP(uint8_t dns_no) {
return IPAddress(dns_getserver(dns_no)); return IPAddress(dns_getserver(dns_no));
} }
/**
* Get the broadcast ip address.
* @return IPAddress Bradcast IP
*/
IPAddress ESP8266WiFiSTAClass::broadcastIP()
{
struct ip_info ip;
wifi_get_ip_info(STATION_IF, &ip);
return IPAddress(ip.ip.addr | ~(ip.netmask.addr));
}
/** /**
* Return Connection status. * Return Connection status.
* @return one of the value defined in wl_status_t * @return one of the value defined in wl_status_t

View File

@ -70,6 +70,7 @@ class ESP8266WiFiSTAClass: public LwipIntf {
IPAddress gatewayIP(); IPAddress gatewayIP();
IPAddress dnsIP(uint8_t dns_no = 0); IPAddress dnsIP(uint8_t dns_no = 0);
IPAddress broadcastIP();
// STA WiFi info // STA WiFi info
wl_status_t status(); wl_status_t status();
String SSID() const; String SSID() const;