void WebServer::process() { word len = ether.packetReceive(); word pos = ether.packetLoop(len); if (pos) { char *data = (char *) Ethernet::buffer + pos; if (strncmp("GET /", data, 5) == 0) { char command = data[5]; char value = data[6]; _respond(command, value); } else { memcpy_P(ether.tcpOffset(), _page_err, sizeof _page_err); ether.httpServerReply(sizeof _page_err - 1); // data += 5; // if (data[0] == '1') { // lampScreen.turnOn(); // } else if (data[0] == '2') { // lampBar.turnOn(); // } else if (data[0] == '3') { // lampScreen.turnOff(); // } else if (data[0] == '4') { // lampBar.turnOff(); // } // delay(1); // returnStatus(); } } }
int respond(void *v) { int *msgvec = v; if (value("Replyall") == NULL) return(_respond(msgvec)); else return(_Respond(msgvec)); }