Unverified Commit 7a376846 authored by rstephan's avatar rstephan Committed by GitHub

Soft-AP: get subnet mask (#8358)

In WiFiSTA you can ask for the subnet mask, but not in WiFiAP.
Only the CIDR is reported.
Therefor the missing method is added to have the same features in softAP as well.
parent 289c2a14
......@@ -222,6 +222,15 @@ Get the softAP subnet CIDR.
uint8_t softAPSubnetCIDR();
softAPSubnetMask
****************
Get the softAP subnet mask.
.. code-block:: arduino
IPAddress softAPSubnetMask();
softAPenableIpV6
****************
......
......@@ -304,10 +304,10 @@ IPAddress WiFiAPClass::softAPNetworkID()
}
/**
* Get the softAP subnet CIDR.
* @return uint8_t softAP subnetCIDR
* Get the softAP subnet mask.
* @return IPAddress subnetMask
*/
uint8_t WiFiAPClass::softAPSubnetCIDR()
IPAddress WiFiAPClass::softAPSubnetMask()
{
esp_netif_ip_info_t ip;
if(WiFiGenericClass::getMode() == WIFI_MODE_NULL){
......@@ -317,7 +317,16 @@ uint8_t WiFiAPClass::softAPSubnetCIDR()
log_e("Netif Get IP Failed!");
return IPAddress();
}
return WiFiGenericClass::calculateSubnetCIDR(IPAddress(ip.netmask.addr));
return IPAddress(ip.netmask.addr);
}
/**
* Get the softAP subnet CIDR.
* @return uint8_t softAP subnetCIDR
*/
uint8_t WiFiAPClass::softAPSubnetCIDR()
{
return WiFiGenericClass::calculateSubnetCIDR(softAPSubnetMask());
}
/**
......
......@@ -51,6 +51,7 @@ public:
IPAddress softAPBroadcastIP();
IPAddress softAPNetworkID();
IPAddress softAPSubnetMask();
uint8_t softAPSubnetCIDR();
bool softAPenableIpV6();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment