|
|
|
@ -690,10 +690,11 @@ int StreamConnection::gobbleMatch(const char * separators, const char * target)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void setup () {
|
|
|
|
|
Serial.begin(9600);
|
|
|
|
|
Serial.println("Setup enter...");
|
|
|
|
|
// Serial.begin(9600);
|
|
|
|
|
Serial.begin(19200);
|
|
|
|
|
///Serial.println("Setup enter...");
|
|
|
|
|
|
|
|
|
|
Serial.println("Start W5100 configuration...");
|
|
|
|
|
///Serial.println("Start W5100 configuration...");
|
|
|
|
|
|
|
|
|
|
SPI.begin();
|
|
|
|
|
|
|
|
|
@ -706,18 +707,45 @@ void setup () {
|
|
|
|
|
|
|
|
|
|
Network.device.setGateway(192,168,2,101);
|
|
|
|
|
|
|
|
|
|
Serial.println("End W5100 configuration...");
|
|
|
|
|
///Serial.println("End W5100 configuration...");
|
|
|
|
|
|
|
|
|
|
pinMode(PIN_LED, OUTPUT);
|
|
|
|
|
digitalWrite(PIN_LED, HIGH);
|
|
|
|
|
|
|
|
|
|
Serial.println("Setup exit...");
|
|
|
|
|
///Serial.println("Setup exit...");
|
|
|
|
|
|
|
|
|
|
// Serial.println(((analogRead(2)*70)/630)/10+'0', BYTE);
|
|
|
|
|
|
|
|
|
|
/**/
|
|
|
|
|
Serial.println("Test sockets...");
|
|
|
|
|
///Serial.println("Test sockets...");
|
|
|
|
|
|
|
|
|
|
NetworkConnection conn = Network.listen(7);
|
|
|
|
|
|
|
|
|
|
///Serial.println("Waiting for connection...");
|
|
|
|
|
|
|
|
|
|
while (!conn.isConnected()) {
|
|
|
|
|
//Serial.print(!conn.isConnected());
|
|
|
|
|
delay(500);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
///Serial.println("Connected...");
|
|
|
|
|
|
|
|
|
|
while (conn.isConnected()) {
|
|
|
|
|
if (conn.available()) {
|
|
|
|
|
// Serial.print(conn.read(), BYTE);
|
|
|
|
|
//conn.print(conn.read());
|
|
|
|
|
Serial.print(conn.read(), BYTE);
|
|
|
|
|
}
|
|
|
|
|
if (Serial.available()) {
|
|
|
|
|
conn.print(Serial.read());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
///Serial.println("");
|
|
|
|
|
|
|
|
|
|
conn.close();
|
|
|
|
|
|
|
|
|
|
#if 0
|
|
|
|
|
#if 1
|
|
|
|
|
#if 1 //b
|
|
|
|
|
|
|
|
|
@ -725,6 +753,8 @@ void setup () {
|
|
|
|
|
Serial.println("halting");
|
|
|
|
|
while (1) {};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
NetworkConnection conn = Network.connect(209,177,146,34, 6667); // TODO: Better?
|
|
|
|
|
|
|
|
|
|
Serial.println("Waiting to connect...");
|
|
|
|
@ -946,9 +976,9 @@ void setup () {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
#endif // a-1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Serial.println("End test and dummy loop");
|
|
|
|
|
///Serial.println("End test and dummy loop");
|
|
|
|
|
while (1) {}
|
|
|
|
|
/**/
|
|
|
|
|
}
|
|
|
|
|