Skip to content

Commit

Permalink
Add softAPbroadcastIP (#8963)
Browse files Browse the repository at this point in the history
  • Loading branch information
rafal-tarnow committed Jul 26, 2023
1 parent 90c4e3a commit f2da54d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
11 changes: 11 additions & 0 deletions libraries/ESP8266WiFi/src/ESP8266WiFiAP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,17 @@ IPAddress ESP8266WiFiAPClass::softAPIP() {
return IPAddress(ip.ip.addr);
}

/**
* Get the softAP broadcast ip address.
* @return IPAddress softAP broadcast IP
*/
IPAddress ESP8266WiFiAPClass::softAPbroadcastIP()
{
struct ip_info ip;
wifi_get_ip_info(SOFTAP_IF, &ip);
return IPAddress(ip.ip.addr | ~(ip.netmask.addr));
}


/**
* Get the softAP interface MAC address.
Expand Down
1 change: 1 addition & 0 deletions libraries/ESP8266WiFi/src/ESP8266WiFiAP.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class ESP8266WiFiAPClass {
uint8_t softAPgetStationNum();

IPAddress softAPIP();
IPAddress softAPbroadcastIP();

uint8_t* softAPmacAddress(uint8_t* mac);
String softAPmacAddress(void);
Expand Down

0 comments on commit f2da54d

Please sign in to comment.