File tree Expand file tree Collapse file tree 3 files changed +26
-7
lines changed Expand file tree Collapse file tree 3 files changed +26
-7
lines changed Original file line number Diff line number Diff line change @@ -222,6 +222,15 @@ Get the softAP subnet CIDR.
222222
223223 uint8_t softAPSubnetCIDR();
224224
225+ softAPSubnetMask
226+ ****************
227+
228+ Get the softAP subnet mask.
229+
230+ .. code-block :: arduino
231+
232+ IPAddress softAPSubnetMask();
233+
225234 softAPenableIpV6
226235****************
227236
Original file line number Diff line number Diff line change @@ -304,20 +304,29 @@ IPAddress WiFiAPClass::softAPNetworkID()
304304}
305305
306306/* *
307- * Get the softAP subnet CIDR .
308- * @return uint8_t softAP subnetCIDR
307+ * Get the softAP subnet mask .
308+ * @return IPAddress subnetMask
309309 */
310- uint8_t WiFiAPClass::softAPSubnetCIDR ()
310+ IPAddress WiFiAPClass::softAPSubnetMask ()
311311{
312- esp_netif_ip_info_t ip;
312+ esp_netif_ip_info_t ip;
313313 if (WiFiGenericClass::getMode () == WIFI_MODE_NULL){
314314 return IPAddress ();
315315 }
316316 if (esp_netif_get_ip_info (get_esp_interface_netif (ESP_IF_WIFI_AP), &ip) != ESP_OK){
317- log_e (" Netif Get IP Failed!" );
318- return IPAddress ();
317+ log_e (" Netif Get IP Failed!" );
318+ return IPAddress ();
319319 }
320- return WiFiGenericClass::calculateSubnetCIDR (IPAddress (ip.netmask .addr ));
320+ return IPAddress (ip.netmask .addr );
321+ }
322+
323+ /* *
324+ * Get the softAP subnet CIDR.
325+ * @return uint8_t softAP subnetCIDR
326+ */
327+ uint8_t WiFiAPClass::softAPSubnetCIDR ()
328+ {
329+ return WiFiGenericClass::calculateSubnetCIDR (softAPSubnetMask ());
321330}
322331
323332/* *
Original file line number Diff line number Diff line change @@ -51,6 +51,7 @@ class WiFiAPClass
5151
5252 IPAddress softAPBroadcastIP ();
5353 IPAddress softAPNetworkID ();
54+ IPAddress softAPSubnetMask ();
5455 uint8_t softAPSubnetCIDR ();
5556
5657 bool softAPenableIpV6 ();
You can’t perform that action at this time.
0 commit comments