Skip to content

Commit

Permalink
Revert "fixed typos, brought back LED to blink"
Browse files Browse the repository at this point in the history
This reverts commit 6014297.
  • Loading branch information
ficeto authored and ficeto committed May 1, 2015
1 parent 54bff7c commit 1da4b20
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,14 @@
const char* ssid = "........";
const char* password = "........";
MDNSResponder mdns;
ESP8266WebServer server(80);

const int led = 13;
ESP8266WebServer server(80);

void handle_root() {
digitalWrite(led, 1);
server.send(200, "text/plain", "hello from esp8266!");
digitalWrite(led, 0);
}

bool handle_not_found(){
digitalWrite(led, 1);
String message = "URI: ";
message += server.uri();
message += "\nMethod: ";
Expand All @@ -30,14 +26,11 @@ bool handle_not_found(){
}
message += "\nNotFound!";
server.send(404, "text/plain", message);
digitalWrite(led, 0);
return true;
}

void setup(void){
Serial.begin(115200);
pinMode(led, OUTPUT);
digitalWrite(led, 0);
WiFi.begin(ssid, password);
Serial.println("");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,15 @@ class ESP8266WebServer
typedef std::function<bool(void)> TNotFoundHandlerFunction;
void on(const char* uri, THandlerFunction handler);
void on(const char* uri, HTTPMethod method, THandlerFunction fn);
//called when handler is not assigned, return true if you handle it else return false to let the class return 404
void onNotFound(TNotFoundHandlerFunction fn);
void onNotFound(TNotFoundHandlerFunction fn);//called when handler is not assigned

String uri() { return _currentUri; }
HTTPMethod method() { return _currentMethod; }
WiFiClient client() { return _currentClient; }

String arg(const char* name);// get request argument value
String arg(int i);// get request argument value by number
String argName(int i);// get request argument name by number
String arg(int i);// get request argument value buy number
String argName(int i);// get request argument name buy number
int args();//get arguments count
bool hasArg(const char* name);//check if argument exists

Expand Down

0 comments on commit 1da4b20

Please sign in to comment.