File tree 3 files changed +26
-7
lines changed
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.
222
222
223
223
uint8_t softAPSubnetCIDR();
224
224
225
+ softAPSubnetMask
226
+ ****************
227
+
228
+ Get the softAP subnet mask.
229
+
230
+ .. code-block :: arduino
231
+
232
+ IPAddress softAPSubnetMask();
233
+
225
234
softAPenableIpV6
226
235
****************
227
236
Original file line number Diff line number Diff line change @@ -304,20 +304,29 @@ IPAddress WiFiAPClass::softAPNetworkID()
304
304
}
305
305
306
306
/* *
307
- * Get the softAP subnet CIDR .
308
- * @return uint8_t softAP subnetCIDR
307
+ * Get the softAP subnet mask .
308
+ * @return IPAddress subnetMask
309
309
*/
310
- uint8_t WiFiAPClass::softAPSubnetCIDR ()
310
+ IPAddress WiFiAPClass::softAPSubnetMask ()
311
311
{
312
- esp_netif_ip_info_t ip;
312
+ esp_netif_ip_info_t ip;
313
313
if (WiFiGenericClass::getMode () == WIFI_MODE_NULL){
314
314
return IPAddress ();
315
315
}
316
316
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 ();
319
319
}
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 ());
321
330
}
322
331
323
332
/* *
Original file line number Diff line number Diff line change @@ -51,6 +51,7 @@ class WiFiAPClass
51
51
52
52
IPAddress softAPBroadcastIP ();
53
53
IPAddress softAPNetworkID ();
54
+ IPAddress softAPSubnetMask ();
54
55
uint8_t softAPSubnetCIDR ();
55
56
56
57
bool softAPenableIpV6 ();
You can’t perform that action at this time.
0 commit comments