Documentation - Improvement - WiFiSubnetMask

Hi
possibly the code fragment associated with the example should be amended.

Serial.println();

Might read

Serial.println(subnet);

or similar as the code does not actually output the ‘subnet’ obtained from the WiFi.subnetMask(); call.
Some formatting may be required.

Complete code fragment is shown below, there is only one Serial.println();

Web page retrieved from:
https://www.arduino.cc/en/Reference/WiFiSubnetMask

#include <WiFi.h>
int status = WL_IDLE_STATUS; // the Wifi radio’s status

//SSID of your network
char ssid = “yourNetwork”;
//password of your WPA Network
char pass = “secretPassword”;

IPAddress ip;
IPAddress subnet;
IPAddress gateway;

void setup()
{
WiFi.begin(ssid, pass);

if ( status != WL_CONNECTED) {
Serial.println(“Couldn’t get a wifi connection”);
while(true);
}
// if you are connected, print out info about the connection:
else {

// print your subnet mask:
subnet = WiFi.subnetMask();
Serial.print("NETMASK: ");
Serial.println();

}
}

void loop () {
}

Reported to the issue tracker at:

Thanks for pointing this issue out!

The example code has now been fixed. Thanks Conseils!