| 17 | class WebServer; |
| 18 | |
| 19 | class HTTPUpdateServer { |
| 20 | public: |
| 21 | explicit HTTPUpdateServer(bool serial_debug = false) : _serial_output(serial_debug), _server(nullptr), _username(_emptyString), _password(_emptyString), _authenticated(false) {} |
| 22 | ~HTTPUpdateServer() {} |
| 23 | void setup(WebServer* server) { setup(server, _emptyString, _emptyString); } |
| 24 | void setup(WebServer* server, const String& path) { setup(server, path, _emptyString, _emptyString); } |
| 25 | void setup(WebServer* server, const String& username, const String& password) { setup(server, "/update", username, password); } |
| 26 | void setup(WebServer* server, const String& path, const String& username, const String& password); |
| 27 | void updateCredentials(const String& username, const String& password) { _username = username; _password = password; } |
| 28 | |
| 29 | protected: |
| 30 | void _setUpdaterError(); |
| 31 | |
| 32 | private: |
| 33 | bool _serial_output; |
| 34 | WebServer* _server; |
| 35 | String _username; |
| 36 | String _password; |
| 37 | bool _authenticated; |
| 38 | String _updaterError; |
| 39 | static const String _emptyString; |
| 40 | }; |
| 41 | |
| 42 | #endif // !ARDUINO_ARCH_ESP32 |
| 43 | #endif // !__HTTP_UPDATE_SERVER_H |
nothing calls this directly
no outgoing calls
no test coverage detected