Skip to content

Clean up comments in Ethernet library examples #3919

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 5, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@

A more advanced server that distributes any incoming messages
to all connected clients but the client the message comes from.
To use telnet to your device's IP address and type.
To use, telnet to your device's IP address and type.
You can see the client's input in the serial monitor as well.
Using an Arduino Wiznet Ethernet shield.

Circuit:
* Ethernet shield attached to pins 10, 11, 12, 13
* Analog inputs attached to pins A0 through A5 (optional)

created 18 Dec 2009
by David A. Mellis
Expand Down Expand Up @@ -41,7 +40,7 @@ EthernetServer server(23);
EthernetClient clients[4];

void setup() {
// initialize the ethernet device
// initialize the Ethernet device
Ethernet.begin(mac, ip, myDns, gateway, subnet);
// start listening for clients
server.begin();
Expand Down Expand Up @@ -77,7 +76,7 @@ void loop() {
for (byte i = 0; i < 4; i++) {
if (!clients[i] && clients[i] != client) {
clients[i] = client;
// clead out the input buffer:
// clear out the input buffer:
client.flush();
Serial.println("We have a new client");
client.print("Hello, client number: ");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include <SPI.h>


// assign a MAC address for the ethernet controller.
// assign a MAC address for the Ethernet controller.
// fill in your address here:
byte mac[] = {
0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED
Expand Down
7 changes: 3 additions & 4 deletions libraries/Ethernet/examples/ChatServer/ChatServer.ino
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
/*
Chat Server
Chat Server

A simple server that distributes any incoming messages to all
connected clients. To use telnet to your device's IP address and type.
connected clients. To use, telnet to your device's IP address and type.
You can see the client's input in the serial monitor as well.
Using an Arduino Wiznet Ethernet shield.

Circuit:
* Ethernet shield attached to pins 10, 11, 12, 13
* Analog inputs attached to pins A0 through A5 (optional)

created 18 Dec 2009
by David A. Mellis
Expand Down Expand Up @@ -59,7 +58,7 @@ void loop() {
// when the client sends the first byte, say hello:
if (client) {
if (!alreadyConnected) {
// clead out the input buffer:
// clear out the input buffer:
client.flush();
Serial.println("We have a new client");
client.println("Hello, client!");
Expand Down
4 changes: 2 additions & 2 deletions libraries/Ethernet/examples/DhcpChatServer/DhcpChatServer.ino
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
DHCP Chat Server

A simple server that distributes any incoming messages to all
connected clients. To use telnet to your device's IP address and type.
connected clients. To use, telnet to your device's IP address and type.
You can see the client's input in the serial monitor as well.
Using an Arduino Wiznet Ethernet shield.

Expand Down Expand Up @@ -51,7 +51,7 @@ void setup() {
Serial.println("Trying to get an IP address using DHCP");
if (Ethernet.begin(mac) == 0) {
Serial.println("Failed to configure Ethernet using DHCP");
// initialize the ethernet device not using DHCP:
// initialize the Ethernet device not using DHCP:
Ethernet.begin(mac, ip, myDns, gateway, subnet);
}
// print your local IP address:
Expand Down
2 changes: 1 addition & 1 deletion libraries/Ethernet/examples/TelnetClient/TelnetClient.ino
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ IPAddress server(1, 1, 1, 1);
// Initialize the Ethernet client library
// with the IP address and port of the server
// that you want to connect to (port 23 is default for telnet;
// if you're using Processing's ChatServer, use port 10002):
// if you're using Processing's ChatServer, use port 10002):
EthernetClient client;

void setup() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
UDPSendReceive.pde:
UDPSendReceiveString:
This sketch receives UDP message strings, prints them to the serial port
and sends an "acknowledge" string back to the sender

Expand Down Expand Up @@ -28,7 +28,7 @@ IPAddress ip(192, 168, 1, 177);
unsigned int localPort = 8888; // local port to listen on

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

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

// send a reply, to the IP address and port that sent us the packet we received
// send a reply to the IP address and port that sent us the packet we received
Udp.beginPacket(Udp.remoteIP(), Udp.remotePort());
Udp.write(ReplyBuffer);
Udp.endPacket();
Expand Down
4 changes: 2 additions & 2 deletions libraries/Ethernet/examples/UdpNtpClient/UdpNtpClient.ino
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ void loop() {
// We've received a packet, read the data from it
Udp.read(packetBuffer, NTP_PACKET_SIZE); // read the packet into the buffer

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

unsigned long highWord = word(packetBuffer[40], packetBuffer[41]);
unsigned long lowWord = word(packetBuffer[42], packetBuffer[43]);
Expand Down
3 changes: 1 addition & 2 deletions libraries/Ethernet/examples/WebClient/WebClient.ino
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ void setup() {
// start the Ethernet connection:
if (Ethernet.begin(mac) == 0) {
Serial.println("Failed to configure Ethernet using DHCP");
// no point in carrying on, so do nothing forevermore:
// try to congifure using IP address instead of DHCP:
Ethernet.begin(mac, ip);
}
Expand All @@ -60,7 +59,7 @@ void setup() {
client.println("Connection: close");
client.println();
} else {
// kf you didn't get a connection to the server:
// if you didn't get a connection to the server:
Serial.println("connection failed");
}
}
Expand Down