mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 15:59:52 +03:00
29 lines
600 B
C++
29 lines
600 B
C++
#ifndef RestartService_h
|
|
#define RestartService_h
|
|
|
|
#include <WiFi.h>
|
|
#include <AsyncTCP.h>
|
|
|
|
#include <ESPAsyncWebServer.h>
|
|
#include <SecurityManager.h>
|
|
|
|
#define RESTART_SERVICE_PATH "/rest/restart"
|
|
#define PARTITION_SERVICE_PATH "/rest/partition"
|
|
|
|
class RestartService {
|
|
public:
|
|
RestartService(AsyncWebServer * server, SecurityManager * securityManager);
|
|
|
|
static void restartNow() {
|
|
WiFi.disconnect(true);
|
|
delay(500);
|
|
ESP.restart();
|
|
}
|
|
|
|
private:
|
|
void restart(AsyncWebServerRequest * request);
|
|
void partition(AsyncWebServerRequest * request);
|
|
};
|
|
|
|
#endif
|