Skip to content

Commit f2da54d

Browse files
authored
Add softAPbroadcastIP (esp8266#8963)
1 parent 90c4e3a commit f2da54d

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

Diff for: libraries/ESP8266WiFi/src/ESP8266WiFiAP.cpp

+11
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,17 @@ IPAddress ESP8266WiFiAPClass::softAPIP() {
323323
return IPAddress(ip.ip.addr);
324324
}
325325

326+
/**
327+
* Get the softAP broadcast ip address.
328+
* @return IPAddress softAP broadcast IP
329+
*/
330+
IPAddress ESP8266WiFiAPClass::softAPbroadcastIP()
331+
{
332+
struct ip_info ip;
333+
wifi_get_ip_info(SOFTAP_IF, &ip);
334+
return IPAddress(ip.ip.addr | ~(ip.netmask.addr));
335+
}
336+
326337

327338
/**
328339
* Get the softAP interface MAC address.

Diff for: libraries/ESP8266WiFi/src/ESP8266WiFiAP.h

+1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ class ESP8266WiFiAPClass {
4545
uint8_t softAPgetStationNum();
4646

4747
IPAddress softAPIP();
48+
IPAddress softAPbroadcastIP();
4849

4950
uint8_t* softAPmacAddress(uint8_t* mac);
5051
String softAPmacAddress(void);

0 commit comments

Comments
 (0)