1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-08-01 03:47:23 +03:00

Debug on Server TCP

This commit is contained in:
mlafauci
2011-04-21 07:47:54 +02:00
parent 41bce76a03
commit 49912f241f
12 changed files with 153 additions and 110 deletions

View File

@ -119,8 +119,10 @@ void setup()
{
Serial.begin(9600);
Serial.println("*** Start WiFi example ***");
delay(3000);
WiFi.begin();
scanNetworks();
startWiFiWep();
@ -130,42 +132,12 @@ void setup()
printIpData();
printCurrNet();
scanNetworks();
Serial.println("Starting server...");
server.begin();
delay(1000);
printCurrNet();
}
}
void loop()
{
if (status == WL_CONNECTED)
{
byte _status = 0;
Client client = server.available(&_status);
if (client) {
//Serial.print("Status: ");
//Serial.println(status, 16);
byte idx = 0;
while (client.available())
{
dataBuf[idx++] = client.read();
}
if (idx>0)
{
dataBuf[idx]=0;
Serial.println((char*)&dataBuf[0]);
server.write((char*)&dataBuf[0]);
}
return;
}
}
}