1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-13 13:01:55 +03:00

Extracted the WebUpdate example into a library.

This ESP8266HTTPUpdateServer can be instantiated and used
more cleanly, it's also able to take or create an ESP8266WebServer
to configure the events and /update handler.

It's been made more robust by handling upload abort, which
depends on fix provided for issue #833
This commit is contained in:
Miguel Angel Ajo
2015-09-29 13:01:01 +02:00
parent b4cc0c263e
commit 065e1ccb8c
5 changed files with 165 additions and 0 deletions

View File

@ -0,0 +1,18 @@
#ifndef __HTTP_UPDATE_SERVER_H
#define __HTTP_UPDATE_SERVER_H
class ESP8266WebServer;
class ESP8266HTTPUpdateServer
{
private:
bool _serial_output;
ESP8266WebServer *_server;
static const char *_serverIndex;
public:
ESP8266HTTPUpdateServer(bool serial_debug=false);
void setup(ESP8266WebServer *server=NULL);
};
#endif