Skip to content

Commit db61235

Browse files
committed
Merge pull request arduino#3919 from per1234/ethernet-examples-comments
Clean up comments in Ethernet library examples
2 parents 10fafd7 + 7f4c299 commit db61235

File tree

8 files changed

+16
-19
lines changed

8 files changed

+16
-19
lines changed

libraries/Ethernet/examples/AdvancedChatServer/AdvancedChatServer.ino

+3-4
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,12 @@
33
44
A more advanced server that distributes any incoming messages
55
to all connected clients but the client the message comes from.
6-
To use telnet to your device's IP address and type.
6+
To use, telnet to your device's IP address and type.
77
You can see the client's input in the serial monitor as well.
88
Using an Arduino Wiznet Ethernet shield.
99
1010
Circuit:
1111
* Ethernet shield attached to pins 10, 11, 12, 13
12-
* Analog inputs attached to pins A0 through A5 (optional)
1312
1413
created 18 Dec 2009
1514
by David A. Mellis
@@ -41,7 +40,7 @@ EthernetServer server(23);
4140
EthernetClient clients[4];
4241

4342
void setup() {
44-
// initialize the ethernet device
43+
// initialize the Ethernet device
4544
Ethernet.begin(mac, ip, myDns, gateway, subnet);
4645
// start listening for clients
4746
server.begin();
@@ -77,7 +76,7 @@ void loop() {
7776
for (byte i = 0; i < 4; i++) {
7877
if (!clients[i] && clients[i] != client) {
7978
clients[i] = client;
80-
// clead out the input buffer:
79+
// clear out the input buffer:
8180
client.flush();
8281
Serial.println("We have a new client");
8382
client.print("Hello, client number: ");

libraries/Ethernet/examples/BarometricPressureWebServer/BarometricPressureWebServer.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#include <SPI.h>
2727

2828

29-
// assign a MAC address for the ethernet controller.
29+
// assign a MAC address for the Ethernet controller.
3030
// fill in your address here:
3131
byte mac[] = {
3232
0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED

libraries/Ethernet/examples/ChatServer/ChatServer.ino

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
/*
2-
Chat Server
2+
Chat Server
33
44
A simple server that distributes any incoming messages to all
5-
connected clients. To use telnet to your device's IP address and type.
5+
connected clients. To use, telnet to your device's IP address and type.
66
You can see the client's input in the serial monitor as well.
77
Using an Arduino Wiznet Ethernet shield.
88
99
Circuit:
1010
* Ethernet shield attached to pins 10, 11, 12, 13
11-
* Analog inputs attached to pins A0 through A5 (optional)
1211
1312
created 18 Dec 2009
1413
by David A. Mellis
@@ -59,7 +58,7 @@ void loop() {
5958
// when the client sends the first byte, say hello:
6059
if (client) {
6160
if (!alreadyConnected) {
62-
// clead out the input buffer:
61+
// clear out the input buffer:
6362
client.flush();
6463
Serial.println("We have a new client");
6564
client.println("Hello, client!");

libraries/Ethernet/examples/DhcpChatServer/DhcpChatServer.ino

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
DHCP Chat Server
33
44
A simple server that distributes any incoming messages to all
5-
connected clients. To use telnet to your device's IP address and type.
5+
connected clients. To use, telnet to your device's IP address and type.
66
You can see the client's input in the serial monitor as well.
77
Using an Arduino Wiznet Ethernet shield.
88
@@ -51,7 +51,7 @@ void setup() {
5151
Serial.println("Trying to get an IP address using DHCP");
5252
if (Ethernet.begin(mac) == 0) {
5353
Serial.println("Failed to configure Ethernet using DHCP");
54-
// initialize the ethernet device not using DHCP:
54+
// initialize the Ethernet device not using DHCP:
5555
Ethernet.begin(mac, ip, myDns, gateway, subnet);
5656
}
5757
// print your local IP address:

libraries/Ethernet/examples/TelnetClient/TelnetClient.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ IPAddress server(1, 1, 1, 1);
3434
// Initialize the Ethernet client library
3535
// with the IP address and port of the server
3636
// that you want to connect to (port 23 is default for telnet;
37-
// if you're using Processing's ChatServer, use port 10002):
37+
// if you're using Processing's ChatServer, use port 10002):
3838
EthernetClient client;
3939

4040
void setup() {

libraries/Ethernet/examples/UDPSendReceiveString/UDPSendReceiveString.ino

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
UDPSendReceive.pde:
2+
UDPSendReceiveString:
33
This sketch receives UDP message strings, prints them to the serial port
44
and sends an "acknowledge" string back to the sender
55
@@ -28,7 +28,7 @@ IPAddress ip(192, 168, 1, 177);
2828
unsigned int localPort = 8888; // local port to listen on
2929

3030
// buffers for receiving and sending data
31-
char packetBuffer[UDP_TX_PACKET_MAX_SIZE]; //buffer to hold incoming packet,
31+
char packetBuffer[UDP_TX_PACKET_MAX_SIZE]; //buffer to hold incoming packet,
3232
char ReplyBuffer[] = "acknowledged"; // a string to send back
3333

3434
// An EthernetUDP instance to let us send and receive packets over UDP
@@ -64,7 +64,7 @@ void loop() {
6464
Serial.println("Contents:");
6565
Serial.println(packetBuffer);
6666

67-
// send a reply, to the IP address and port that sent us the packet we received
67+
// send a reply to the IP address and port that sent us the packet we received
6868
Udp.beginPacket(Udp.remoteIP(), Udp.remotePort());
6969
Udp.write(ReplyBuffer);
7070
Udp.endPacket();

libraries/Ethernet/examples/UdpNtpClient/UdpNtpClient.ino

+2-2
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ void loop() {
6666
// We've received a packet, read the data from it
6767
Udp.read(packetBuffer, NTP_PACKET_SIZE); // read the packet into the buffer
6868

69-
//the timestamp starts at byte 40 of the received packet and is four bytes,
70-
// or two words, long. First, esxtract the two words:
69+
// the timestamp starts at byte 40 of the received packet and is four bytes,
70+
// or two words, long. First, extract the two words:
7171

7272
unsigned long highWord = word(packetBuffer[40], packetBuffer[41]);
7373
unsigned long lowWord = word(packetBuffer[42], packetBuffer[43]);

libraries/Ethernet/examples/WebClient/WebClient.ino

+1-2
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ void setup() {
4343
// start the Ethernet connection:
4444
if (Ethernet.begin(mac) == 0) {
4545
Serial.println("Failed to configure Ethernet using DHCP");
46-
// no point in carrying on, so do nothing forevermore:
4746
// try to congifure using IP address instead of DHCP:
4847
Ethernet.begin(mac, ip);
4948
}
@@ -60,7 +59,7 @@ void setup() {
6059
client.println("Connection: close");
6160
client.println();
6261
} else {
63-
// kf you didn't get a connection to the server:
62+
// if you didn't get a connection to the server:
6463
Serial.println("connection failed");
6564
}
6665
}

0 commit comments

Comments
 (0)