Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit f2da54d

Browse filesBrowse files
authored
Add softAPbroadcastIP (esp8266#8963)
1 parent 90c4e3a commit f2da54d
Copy full SHA for f2da54d

File tree

Expand file treeCollapse file tree

2 files changed

+12
-0
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+12
-0
lines changed

‎libraries/ESP8266WiFi/src/ESP8266WiFiAP.cpp

Copy file name to clipboardExpand all lines: libraries/ESP8266WiFi/src/ESP8266WiFiAP.cpp
+11Lines changed: 11 additions & 0 deletions
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.

‎libraries/ESP8266WiFi/src/ESP8266WiFiAP.h

Copy file name to clipboardExpand all lines: libraries/ESP8266WiFi/src/ESP8266WiFiAP.h
+1Lines changed: 1 addition & 0 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.