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