Permalink
Browse files

Updated all Arduino Ethernet libraries to work with changes to Ethern…

…et library for Arduino 1.0beta4 and beyond

The ethernet and Wifi libraries were changed to use a common Client
class. Now, to instantiate a client or server, you use EthernetClient
or WifiClient as the class type.
  • Loading branch information...
Tom Igoe
Tom Igoe committed Sep 20, 2011
1 parent 91df081 commit 586f36507b6e759895080a082630dd4dfe298512
@@ -69,7 +69,7 @@ void loop() {
int requestedFileLength = 0; // length of the filename they asked for
// listen for incoming clients:
Client client = server.available();
EthernetClient client = server.available();
if (client) {
// make an instance of TextFinder to look for stuff from the client:
@@ -71,7 +71,7 @@ void loop() {
int requestedFileLength = 0; // length of the filename they asked for
// listen for incoming clients:
Client client = server.available();
EthernetClient client = server.available();
if (client) {
// make an instance of TextFinder to look for stuff from the client:
@@ -71,7 +71,7 @@ void loop() {
int requestedFileLength = 0; // length of the filename they asked for
// listen for incoming clients:
Client client = server.available();
EthernetClient client = server.available();
if (client) {
// make an instance of TextFinder to look for stuff from the client:
@@ -71,7 +71,7 @@ void loop() {
int requestedFileLength = 0; // length of the filename they asked for
// listen for incoming clients:
Client client = server.available();
EthernetClient client = server.available();
if (client) {
// make an instance of TextFinder to look for stuff from the client:
@@ -17,7 +17,7 @@ IPAddress server(208,201,239,101 );
// Initialize the Ethernet client library
// with the IP address and port of the server
// that you want to connect to (port 80 is default for HTTP):
Client client;
EthernetClient client;
void setup() {

This file was deleted.

Oops, something went wrong.
@@ -32,7 +32,7 @@ void setup()
void loop()
{
// listen for incoming clients
Client client = server.available();
EthernetClient client = server.available();
if (client) {
Serial.println("Got a client");
@@ -25,7 +25,7 @@ void setup()
void loop()
{
// listen for incoming clients
Client client = server.available();
EthernetClient client = server.available();
if (client) {
while (client.connected()) {
if (client.available()) {
@@ -25,7 +25,7 @@ IPAddress server(208,201,239,101 );
// Initialize the Ethernet client library
// with the IP address and port of the server
// that you want to connect to (port 80 is default for HTTP):
Client client;
EthernetClient client;
boolean requested; // whether you've made a request since connecting
long lastAttemptTime = 0; // last time you connected to the server, in milliseconds
@@ -25,7 +25,7 @@ IPAddress server(208,201,239,101 );
// Initialize the Ethernet client library
// with the IP address and port of the server
// that you want to connect to (port 80 is default for HTTP):
Client client;
EthernetClient client;
boolean requested; // whether you've made a request since connecting
long lastAttemptTime = 0; // last time you connected to the server, in milliseconds
@@ -26,7 +26,7 @@ const int right = 891; // threshold for the joystick to go right
const int sendInterval = 20; // minimum time between messages to the server
const int debounceInterval = 15; // used to smooth out pushbutton readings
Client client; // instance of the Client class for connecting
EthernetClient client; // instance of the Client class for connecting
int lastButtonState = 0; // previous state of the pushbutton
long lastTimeSent = 0; // timestamp of the last server message
@@ -25,7 +25,7 @@ const int right = 891; // threshold for the joystick to go right
const int sendInterval = 20; // minimum time between messages to the server
const int debounceInterval = 15; // used to smooth out pushbutton readings
Client client; // instance of the Client class for connecting
EthernetClient client; // instance of the Client class for connecting
int lastButtonState = 0; // previous state of the pushbutton
long lastTimeSent = 0; // timestamp of the last server message
@@ -45,7 +45,7 @@ void setup() {
void loop() {
// listen for incoming clients
Client client = server.available();
WifiClient client = server.available();
if (client) {
Serial.println("Got a client");
@@ -16,7 +16,7 @@ byte mac[] = {
0x00, 0xAA, 0xBB, 0xCC, 0xDE, 0x02 };
IPAddress ip(192,168,1,20); // will only be used if DHCP fails
char serverName[] = "api.hostip.info"; // HostIP's API URL
Client client; // the client connection
EthernetClient client; // the client connection
float latitude = 0.0; // the latitude returned from HostIP
float longitude = 0.0; // the longitude returned from HostIP
@@ -23,7 +23,7 @@ byte mac[] = {
0x00, 0xAA, 0xBB, 0xCC, 0xDE, 0x01 };
IPAddress ip(192,168,1,20); // will only be used if DHCP fails
IPAddress server(199,59,149,200); // Twitter's API address
Client client; // the client connection
EthernetClient client; // the client connection
String twitterHandle = ""; // the tweeter
String tweet = ""; // the tweet
@@ -24,7 +24,7 @@ byte mac[] = {
IPAddress ip(128,12,151,6); // will only be used if DHCP fails
IPAddress server(199,59,149,200); // Twitter's API address
Client client; // the client connection
EthernetClient client; // the client connection
String twitterHandle = ""; // the tweeter
String tweet = ""; // the tweet

0 comments on commit 586f365

Please sign in to comment.