mirror of
https://github.com/esp8266/Arduino.git
synced 2025-07-30 16:24:09 +03:00
Changed names of the Ethernet classes: Client -> EthernetClient, NetClient -> Client, and basic testing performed
This commit is contained in:
@ -39,7 +39,7 @@ IPAddress subnet(255, 255, 255, 0);
|
||||
// Initialize the Ethernet server library
|
||||
// with the IP address and port you want to use
|
||||
// (port 80 is default for HTTP):
|
||||
Server server(80);
|
||||
EthernetServer server(80);
|
||||
|
||||
|
||||
//Sensor's memory register addresses:
|
||||
@ -96,7 +96,7 @@ void loop() {
|
||||
}
|
||||
|
||||
// listen for incoming Ethernet connections:
|
||||
listenForClients();
|
||||
listenForEthernetClients();
|
||||
}
|
||||
|
||||
|
||||
@ -124,9 +124,9 @@ void getData() {
|
||||
Serial.println(" Pa");
|
||||
}
|
||||
|
||||
void listenForClients() {
|
||||
void listenForEthernetClients() {
|
||||
// listen for incoming clients
|
||||
Client client = server.available();
|
||||
EthernetClient client = server.available();
|
||||
if (client) {
|
||||
Serial.println("Got a client");
|
||||
// an http request ends with a blank line
|
||||
|
@ -29,7 +29,7 @@ IPAddress gateway(192,168,1, 1);
|
||||
IPAddress subnet(255, 255, 0, 0);
|
||||
|
||||
// telnet defaults to port 23
|
||||
Server server(23);
|
||||
EthernetServer server(23);
|
||||
boolean gotAMessage = false; // whether or not you got a message from the client yet
|
||||
|
||||
void setup() {
|
||||
@ -43,7 +43,7 @@ void setup() {
|
||||
|
||||
void loop() {
|
||||
// wait for a new client:
|
||||
Client client = server.available();
|
||||
EthernetClient client = server.available();
|
||||
|
||||
// when the client sends the first byte, say hello:
|
||||
if (client) {
|
||||
|
@ -24,7 +24,7 @@ byte mac[] = {
|
||||
// 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() {
|
||||
// start the serial library:
|
||||
|
@ -30,7 +30,7 @@ IPAddress gateway(192,168,1, 1);
|
||||
IPAddress subnet(255, 255, 0, 0);
|
||||
|
||||
// telnet defaults to port 23
|
||||
Server server(23);
|
||||
EthernetServer server(23);
|
||||
boolean gotAMessage = false; // whether or not you got a message from the client yet
|
||||
|
||||
void setup() {
|
||||
@ -59,7 +59,7 @@ void setup() {
|
||||
|
||||
void loop() {
|
||||
// wait for a new client:
|
||||
Client client = server.available();
|
||||
EthernetClient client = server.available();
|
||||
|
||||
// when the client sends the first byte, say hello:
|
||||
if (client) {
|
||||
|
@ -25,7 +25,7 @@ char serverName[] = "www.google.com";
|
||||
// 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() {
|
||||
// start the serial library:
|
||||
|
@ -29,7 +29,7 @@ byte mac[] = {
|
||||
0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED};
|
||||
|
||||
// initialize the library instance:
|
||||
Client client;
|
||||
EthernetClient client;
|
||||
|
||||
long lastConnectionTime = 0; // last time you connected to the server, in milliseconds
|
||||
boolean lastConnected = false; // state of the connection last time through the main loop
|
||||
|
@ -30,7 +30,7 @@ byte mac[] = {
|
||||
0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED};
|
||||
|
||||
// initialize the library instance:
|
||||
Client client;
|
||||
EthernetClient client;
|
||||
|
||||
long lastConnectionTime = 0; // last time you connected to the server, in milliseconds
|
||||
boolean lastConnected = false; // state of the connection last time through the main loop
|
||||
|
@ -33,7 +33,7 @@ IPAddress server(1,1,1,1);
|
||||
// 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):
|
||||
Client client;
|
||||
EthernetClient client;
|
||||
|
||||
void setup() {
|
||||
// start the Ethernet connection:
|
||||
|
@ -33,7 +33,7 @@ byte mac[] = {
|
||||
IPAddress ip(192,168,1,20);
|
||||
|
||||
// initialize the library instance:
|
||||
Client client;
|
||||
EthernetClient client;
|
||||
|
||||
const int requestInterval = 60000; // delay between requests
|
||||
|
||||
|
@ -23,7 +23,7 @@ IPAddress server(173,194,33,104); // Google
|
||||
// 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() {
|
||||
// start the serial library:
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Web Server
|
||||
Web Server
|
||||
|
||||
A simple web server that shows the value of the analog input pins.
|
||||
using an Arduino Wiznet Ethernet shield.
|
||||
@ -26,7 +26,7 @@ IPAddress ip(192,168,1, 177);
|
||||
// Initialize the Ethernet server library
|
||||
// with the IP address and port you want to use
|
||||
// (port 80 is default for HTTP):
|
||||
Server server(80);
|
||||
EthernetServer server(80);
|
||||
|
||||
void setup()
|
||||
{
|
||||
@ -38,7 +38,7 @@ void setup()
|
||||
void loop()
|
||||
{
|
||||
// listen for incoming clients
|
||||
Client client = server.available();
|
||||
EthernetClient client = server.available();
|
||||
if (client) {
|
||||
// an http request ends with a blank line
|
||||
boolean currentLineIsBlank = true;
|
||||
|
Reference in New Issue
Block a user