mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 00:09:51 +03:00
first commit using PsychicHttp
This commit is contained in:
@@ -4,8 +4,10 @@
|
||||
|
||||
using namespace std::placeholders; // for `_1` etc
|
||||
|
||||
OTASettingsService::OTASettingsService(AsyncWebServer * server, FS * fs, SecurityManager * securityManager)
|
||||
: _httpEndpoint(OTASettings::read, OTASettings::update, this, server, OTA_SETTINGS_SERVICE_PATH, securityManager)
|
||||
OTASettingsService::OTASettingsService(PsychicHttpServer * server, FS * fs, SecurityManager * securityManager)
|
||||
: _server(server)
|
||||
, _securityManager(securityManager)
|
||||
, _httpEndpoint(OTASettings::read, OTASettings::update, this, server, OTA_SETTINGS_SERVICE_PATH, securityManager)
|
||||
, _fsPersistence(OTASettings::read, OTASettings::update, this, fs, OTA_SETTINGS_FILE)
|
||||
, _arduinoOTA(nullptr) {
|
||||
WiFi.onEvent(std::bind(&OTASettingsService::WiFiEvent, this, _1, _2));
|
||||
@@ -17,6 +19,10 @@ void OTASettingsService::begin() {
|
||||
configureArduinoOTA();
|
||||
}
|
||||
|
||||
void OTASettingsService::registerURI() {
|
||||
_httpEndpoint.registerURI();
|
||||
}
|
||||
|
||||
void OTASettingsService::loop() {
|
||||
if (_state.enabled && _arduinoOTA) {
|
||||
_arduinoOTA->handle();
|
||||
|
||||
Reference in New Issue
Block a user