From f6b9e9c2abe9eeaa557314cd04b3dd4d191b03e7 Mon Sep 17 00:00:00 2001 From: Joey Babcock Date: Thu, 14 Feb 2019 03:59:55 -0800 Subject: [PATCH] Clarified comments and debug messages in WiFiClient Example (#2389) * Clarified comments and debug messages Made debug messages and comments easier to understand/grammatical fixes * few more fixes --- .../WiFiClientBasic/WiFiClientBasic.ino | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/libraries/WiFi/examples/WiFiClientBasic/WiFiClientBasic.ino b/libraries/WiFi/examples/WiFiClientBasic/WiFiClientBasic.ino index 27901521..647e846f 100644 --- a/libraries/WiFi/examples/WiFiClientBasic/WiFiClientBasic.ino +++ b/libraries/WiFi/examples/WiFiClientBasic/WiFiClientBasic.ino @@ -18,7 +18,7 @@ void setup() Serial.println(); Serial.println(); - Serial.print("Wait for WiFi... "); + Serial.print("Waiting for WiFi... "); while(WiFiMulti.run() != WL_CONNECTED) { Serial.print("."); @@ -39,32 +39,30 @@ void loop() const uint16_t port = 80; const char * host = "192.168.1.1"; // ip or dns - - - Serial.print("connecting to "); + Serial.print("Connecting to "); Serial.println(host); // Use WiFiClient class to create TCP connections WiFiClient client; if (!client.connect(host, port)) { - Serial.println("connection failed"); - Serial.println("wait 5 sec..."); + Serial.println("Connection failed."); + Serial.println("Waiting 5 seconds before retrying..."); delay(5000); return; } - // This will send the request to the server - client.print("Send this data to server"); + // This will send a request to the server + client.print("Send this data to the server"); - //read back one line from server + //read back one line from the server String line = client.readStringUntil('\r'); client.println(line); - Serial.println("closing connection"); + Serial.println("Closing connection."); client.stop(); - Serial.println("wait 5 sec..."); + Serial.println("Waiting 5 seconds before restarting..."); delay(5000); }