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:
@ -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
|
||||||
|
@ -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;
|
||||||
|
Reference in New Issue
Block a user