mirror of
https://github.com/MrUnknownDE/OpenIris-ESPIDF.git
synced 2026-04-19 22:43:45 +02:00
55 lines
1.6 KiB
C++
55 lines
1.6 KiB
C++
#pragma once
|
|
#ifndef PROJECT_CONFIG_HPP
|
|
#define PROJECT_CONFIG_HPP
|
|
#include <Preferences.hpp>
|
|
#include <algorithm>
|
|
#include <helpers.hpp>
|
|
#include <string>
|
|
#include <vector>
|
|
#include "Models.hpp"
|
|
#include "esp_log.h"
|
|
|
|
int getNetworkCount(Preferences* pref);
|
|
|
|
void saveNetworkCount(Preferences* pref, int count);
|
|
|
|
class ProjectConfig
|
|
{
|
|
public:
|
|
explicit ProjectConfig(Preferences* pref);
|
|
virtual ~ProjectConfig();
|
|
|
|
void load();
|
|
void save() const;
|
|
|
|
bool reset();
|
|
|
|
DeviceConfig_t& getDeviceConfig();
|
|
DeviceMode_t& getDeviceModeConfig();
|
|
CameraConfig_t& getCameraConfig();
|
|
std::vector<WiFiConfig_t>& getWifiConfigs();
|
|
AP_WiFiConfig_t& getAPWifiConfig();
|
|
MDNSConfig_t& getMDNSConfig();
|
|
WiFiTxPower_t& getWiFiTxPowerConfig();
|
|
TrackerConfig_t& getTrackerConfig();
|
|
|
|
void setOTAConfig(const std::string& OTALogin, const std::string& OTAPassword, int OTAPort);
|
|
void setLEDDUtyCycleConfig(int led_external_pwm_duty_cycle);
|
|
void setMDNSConfig(const std::string& hostname);
|
|
void setCameraConfig(uint8_t vflip, uint8_t framesize, uint8_t href, uint8_t quality, uint8_t brightness);
|
|
void setWifiConfig(const std::string& networkName, const std::string& ssid, const std::string& password, uint8_t channel, uint8_t power);
|
|
|
|
void deleteWifiConfig(const std::string& networkName);
|
|
|
|
void setAPWifiConfig(const std::string& ssid, const std::string& password, uint8_t channel);
|
|
void setWiFiTxPower(uint8_t power);
|
|
void setDeviceMode(StreamingMode deviceMode);
|
|
StreamingMode getDeviceMode();
|
|
|
|
private:
|
|
Preferences* pref;
|
|
bool _already_loaded;
|
|
TrackerConfig_t config;
|
|
};
|
|
|
|
#endif |