🐹 Renames member
This commit is contained in:
@@ -24,13 +24,13 @@ class CameraSettingsService : public StatefulService<CameraSettings> {
|
||||
CameraSettingsService()
|
||||
: endpoint(CameraSettings::read, CameraSettings::update, this),
|
||||
_eventEndpoint(CameraSettings::read, CameraSettings::update, this, EVENT_CAMERA_SETTINGS),
|
||||
_fsPersistence(CameraSettings::read, CameraSettings::update, this, &ESPFS, CAMERA_SETTINGS_FILE) {
|
||||
_persistence(CameraSettings::read, CameraSettings::update, this, &ESPFS, CAMERA_SETTINGS_FILE) {
|
||||
addUpdateHandler([&](const String &originId) { updateCamera(); }, false);
|
||||
}
|
||||
|
||||
void begin() {
|
||||
_eventEndpoint.begin();
|
||||
_fsPersistence.readFromFS();
|
||||
_persistence.readFromFS();
|
||||
sensor_t *s = safe_sensor_get();
|
||||
_state.pixformat = s->pixformat;
|
||||
_state.framesize = s->status.framesize;
|
||||
@@ -98,7 +98,7 @@ class CameraSettingsService : public StatefulService<CameraSettings> {
|
||||
|
||||
private:
|
||||
EventEndpoint<CameraSettings> _eventEndpoint;
|
||||
FSPersistence<CameraSettings> _fsPersistence;
|
||||
FSPersistence<CameraSettings> _persistence;
|
||||
};
|
||||
|
||||
} // namespace Camera
|
||||
|
||||
@@ -205,9 +205,6 @@ void ESP32SvelteKit::startServices() {
|
||||
#if FT_ENABLED(USE_UPLOAD_FIRMWARE)
|
||||
_uploadFirmwareService.begin();
|
||||
#endif
|
||||
#if FT_ENABLED(USE_DOWNLOAD_FIRMWARE)
|
||||
_downloadFirmwareService.begin();
|
||||
#endif
|
||||
#if FT_ENABLED(USE_NTP)
|
||||
_ntpService.begin();
|
||||
#endif
|
||||
|
||||
@@ -68,15 +68,15 @@ class Peripherals : public StatefulService<PeripheralsConfiguration> {
|
||||
#if FT_ENABLED(USE_BMP)
|
||||
_bmp(10085),
|
||||
#endif
|
||||
_fsPersistence(PeripheralsConfiguration::read, PeripheralsConfiguration::update, this, &ESPFS,
|
||||
DEVICE_CONFIG_FILE) {
|
||||
_persistence(PeripheralsConfiguration::read, PeripheralsConfiguration::update, this, &ESPFS,
|
||||
DEVICE_CONFIG_FILE) {
|
||||
_accessMutex = xSemaphoreCreateMutex();
|
||||
addUpdateHandler([&](const String &originId) { updatePins(); }, false);
|
||||
};
|
||||
|
||||
void begin() {
|
||||
_eventEndpoint.begin();
|
||||
_fsPersistence.readFromFS();
|
||||
_persistence.readFromFS();
|
||||
|
||||
socket.onEvent(EVENT_I2C_SCAN, [&](JsonObject &root, int originId) {
|
||||
scanI2C();
|
||||
@@ -399,7 +399,7 @@ class Peripherals : public StatefulService<PeripheralsConfiguration> {
|
||||
|
||||
private:
|
||||
EventEndpoint<PeripheralsConfiguration> _eventEndpoint;
|
||||
FSPersistence<PeripheralsConfiguration> _fsPersistence;
|
||||
FSPersistence<PeripheralsConfiguration> _persistence;
|
||||
|
||||
SemaphoreHandle_t _accessMutex;
|
||||
inline void beginTransaction() { xSemaphoreTakeRecursive(_accessMutex, portMAX_DELAY); }
|
||||
|
||||
@@ -21,13 +21,13 @@ class ServoController : public StatefulService<ServoSettings> {
|
||||
: _server(server),
|
||||
_peripherals(peripherals),
|
||||
endpoint(ServoSettings::read, ServoSettings::update, this),
|
||||
_fsPersistence(ServoSettings::read, ServoSettings::update, this, &ESPFS, SERVO_SETTINGS_FILE) {}
|
||||
_persistence(ServoSettings::read, ServoSettings::update, this, &ESPFS, SERVO_SETTINGS_FILE) {}
|
||||
|
||||
void begin() {
|
||||
socket.onEvent(EVENT_SERVO_CONFIGURATION_SETTINGS,
|
||||
[&](JsonObject &root, int originId) { servoEvent(root, originId); });
|
||||
socket.onEvent(EVENT_SERVO_STATE, [&](JsonObject &root, int originId) { stateUpdate(root, originId); });
|
||||
_fsPersistence.readFromFS();
|
||||
_persistence.readFromFS();
|
||||
}
|
||||
|
||||
void stateUpdate(JsonObject &root, int originId) {
|
||||
@@ -85,7 +85,7 @@ class ServoController : public StatefulService<ServoSettings> {
|
||||
private:
|
||||
PsychicHttpServer *_server;
|
||||
Peripherals *_peripherals;
|
||||
FSPersistence<ServoSettings> _fsPersistence;
|
||||
FSPersistence<ServoSettings> _persistence;
|
||||
|
||||
bool is_active {true};
|
||||
constexpr static int ServoInterval = 2;
|
||||
|
||||
@@ -4,13 +4,13 @@ static const char *TAG = "APService";
|
||||
|
||||
APService::APService()
|
||||
: endpoint(APSettings::read, APSettings::update, this),
|
||||
_fsPersistence(APSettings::read, APSettings::update, this, &ESPFS, NTP_SETTINGS_FILE) {
|
||||
_persistence(APSettings::read, APSettings::update, this, &ESPFS, NTP_SETTINGS_FILE) {
|
||||
addUpdateHandler([&](const String &originId) { reconfigureAP(); }, false);
|
||||
}
|
||||
|
||||
APService::~APService() {}
|
||||
|
||||
void APService::begin() { _fsPersistence.readFromFS(); }
|
||||
void APService::begin() { _persistence.readFromFS(); }
|
||||
|
||||
esp_err_t APService::getStatus(PsychicRequest *request) {
|
||||
PsychicJsonResponse response = PsychicJsonResponse(request, false);
|
||||
|
||||
@@ -22,7 +22,7 @@ class APService : public StatefulService<APSettings> {
|
||||
|
||||
private:
|
||||
PsychicHttpServer *_server;
|
||||
FSPersistence<APSettings> _fsPersistence;
|
||||
FSPersistence<APSettings> _persistence;
|
||||
|
||||
DNSServer *_dnsServer;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
WiFiService::WiFiService()
|
||||
: endpoint(WiFiSettings::read, WiFiSettings::update, this),
|
||||
_fsPersistence(WiFiSettings::read, WiFiSettings::update, this, &ESPFS, WIFI_SETTINGS_FILE) {
|
||||
_persistence(WiFiSettings::read, WiFiSettings::update, this, &ESPFS, WIFI_SETTINGS_FILE) {
|
||||
addUpdateHandler([&](const String &originId) { reconfigureWiFiConnection(); }, false);
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ void WiFiService::begin() {
|
||||
|
||||
WiFi.onEvent(onStationModeGotIP, WiFiEvent_t::ARDUINO_EVENT_WIFI_STA_GOT_IP);
|
||||
|
||||
_fsPersistence.readFromFS();
|
||||
_persistence.readFromFS();
|
||||
reconfigureWiFiConnection();
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ class WiFiService : public StatefulService<WiFiSettings> {
|
||||
void onStationModeStop(WiFiEvent_t event, WiFiEventInfo_t info);
|
||||
static void onStationModeGotIP(WiFiEvent_t event, WiFiEventInfo_t info);
|
||||
|
||||
FSPersistence<WiFiSettings> _fsPersistence;
|
||||
FSPersistence<WiFiSettings> _persistence;
|
||||
|
||||
void reconfigureWiFiConnection();
|
||||
void manageSTA();
|
||||
|
||||
Reference in New Issue
Block a user