mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 07:49:52 +03:00
auto formatting
This commit is contained in:
@@ -31,44 +31,44 @@
|
||||
#define OTA_SETTINGS_SERVICE_PATH "/rest/otaSettings"
|
||||
|
||||
class OTASettings {
|
||||
public:
|
||||
bool enabled;
|
||||
int port;
|
||||
String password;
|
||||
public:
|
||||
bool enabled;
|
||||
int port;
|
||||
String password;
|
||||
|
||||
static void read(OTASettings& settings, JsonObject& root) {
|
||||
root["enabled"] = settings.enabled;
|
||||
root["port"] = settings.port;
|
||||
root["password"] = settings.password;
|
||||
}
|
||||
static void read(OTASettings & settings, JsonObject & root) {
|
||||
root["enabled"] = settings.enabled;
|
||||
root["port"] = settings.port;
|
||||
root["password"] = settings.password;
|
||||
}
|
||||
|
||||
static StateUpdateResult update(JsonObject& root, OTASettings& settings) {
|
||||
settings.enabled = root["enabled"] | FACTORY_OTA_ENABLED;
|
||||
settings.port = root["port"] | FACTORY_OTA_PORT;
|
||||
settings.password = root["password"] | FACTORY_OTA_PASSWORD;
|
||||
return StateUpdateResult::CHANGED;
|
||||
}
|
||||
static StateUpdateResult update(JsonObject & root, OTASettings & settings) {
|
||||
settings.enabled = root["enabled"] | FACTORY_OTA_ENABLED;
|
||||
settings.port = root["port"] | FACTORY_OTA_PORT;
|
||||
settings.password = root["password"] | FACTORY_OTA_PASSWORD;
|
||||
return StateUpdateResult::CHANGED;
|
||||
}
|
||||
};
|
||||
|
||||
class OTASettingsService : public StatefulService<OTASettings> {
|
||||
public:
|
||||
OTASettingsService(AsyncWebServer* server, FS* fs, SecurityManager* securityManager);
|
||||
public:
|
||||
OTASettingsService(AsyncWebServer * server, FS * fs, SecurityManager * securityManager);
|
||||
|
||||
void begin();
|
||||
void loop();
|
||||
void begin();
|
||||
void loop();
|
||||
|
||||
private:
|
||||
HttpEndpoint<OTASettings> _httpEndpoint;
|
||||
FSPersistence<OTASettings> _fsPersistence;
|
||||
ArduinoOTAClass* _arduinoOTA;
|
||||
private:
|
||||
HttpEndpoint<OTASettings> _httpEndpoint;
|
||||
FSPersistence<OTASettings> _fsPersistence;
|
||||
ArduinoOTAClass * _arduinoOTA;
|
||||
|
||||
void configureArduinoOTA();
|
||||
void configureArduinoOTA();
|
||||
#ifdef ESP32
|
||||
void onStationModeGotIP(WiFiEvent_t event, WiFiEventInfo_t info);
|
||||
void onStationModeGotIP(WiFiEvent_t event, WiFiEventInfo_t info);
|
||||
#elif defined(ESP8266)
|
||||
WiFiEventHandler _onStationModeGotIPHandler;
|
||||
void onStationModeGotIP(const WiFiEventStationModeGotIP& event);
|
||||
WiFiEventHandler _onStationModeGotIPHandler;
|
||||
void onStationModeGotIP(const WiFiEventStationModeGotIP & event);
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif // end OTASettingsService_h
|
||||
#endif // end OTASettingsService_h
|
||||
|
||||
Reference in New Issue
Block a user