mirror of
https://git.mirrors.martin98.com/https://github.com/luc-github/ESP3D.git
synced 2025-10-15 21:31:32 +08:00
removes heretic functions...
apply astyle
This commit is contained in:
parent
ba6b0b708d
commit
03c9e3868c
@ -45,12 +45,19 @@ uint8_t ESP3DOutput::_outputflags = ESP_ALL_CLIENTS;
|
||||
#endif //DISPLAY_DEVICE
|
||||
|
||||
//tool function to avoid string corrupt JSON files
|
||||
const char * encodeString(const char * s){
|
||||
const char * encodeString(const char * s)
|
||||
{
|
||||
static String tmp;
|
||||
tmp = s;
|
||||
while(tmp.indexOf("'")!=-1)tmp.replace("'", "'");
|
||||
while(tmp.indexOf("\"")!=-1)tmp.replace("\"", """);
|
||||
if (tmp =="") tmp=" ";
|
||||
while(tmp.indexOf("'")!=-1) {
|
||||
tmp.replace("'", "'");
|
||||
}
|
||||
while(tmp.indexOf("\"")!=-1) {
|
||||
tmp.replace("\"", """);
|
||||
}
|
||||
if (tmp =="") {
|
||||
tmp=" ";
|
||||
}
|
||||
return tmp.c_str();
|
||||
}
|
||||
|
||||
|
@ -62,7 +62,9 @@ bool Commands::ESP410(const char* cmd_params, level_authenticate_type auth_type,
|
||||
if (!plain) {
|
||||
output->print ("{\"SSID\":\"");
|
||||
output->print (encodeString(WiFi.SSID (i).c_str()));
|
||||
} else output->print (WiFi.SSID (i).c_str());
|
||||
} else {
|
||||
output->print (WiFi.SSID (i).c_str());
|
||||
}
|
||||
if (!plain) {
|
||||
output->print ("\",\"SIGNAL\":\"");
|
||||
} else {
|
||||
|
@ -341,9 +341,12 @@ bool Commands::ESP420(const char* cmd_params, level_authenticate_type auth_type,
|
||||
} else {
|
||||
output->print (": ");
|
||||
}
|
||||
if (!plain)output->print (encodeString(NetConfig::hostname()));
|
||||
else output->print (NetConfig::hostname());
|
||||
|
||||
if (!plain) {
|
||||
output->print (encodeString(NetConfig::hostname()));
|
||||
} else {
|
||||
output->print (NetConfig::hostname());
|
||||
}
|
||||
|
||||
if (!plain) {
|
||||
output->print ("\"}");
|
||||
} else {
|
||||
@ -731,8 +734,11 @@ bool Commands::ESP420(const char* cmd_params, level_authenticate_type auth_type,
|
||||
output->print (": ");
|
||||
}
|
||||
if (WiFi.isConnected()) {
|
||||
if (!plain) output->print (encodeString(WiFi.SSID().c_str()));
|
||||
else output->print (WiFi.SSID().c_str());
|
||||
if (!plain) {
|
||||
output->print (encodeString(WiFi.SSID().c_str()));
|
||||
} else {
|
||||
output->print (WiFi.SSID().c_str());
|
||||
}
|
||||
}
|
||||
if (!plain) {
|
||||
output->print ("\"}");
|
||||
@ -913,8 +919,11 @@ bool Commands::ESP420(const char* cmd_params, level_authenticate_type auth_type,
|
||||
} else {
|
||||
output->print (": ");
|
||||
}
|
||||
if (!plain)output->print (encodeString(WiFiConfig::AP_SSID()));
|
||||
else output->print (WiFiConfig::AP_SSID());
|
||||
if (!plain) {
|
||||
output->print (encodeString(WiFiConfig::AP_SSID()));
|
||||
} else {
|
||||
output->print (WiFiConfig::AP_SSID());
|
||||
}
|
||||
if (!plain) {
|
||||
output->print ("\"}");
|
||||
} else {
|
||||
|
@ -43,17 +43,6 @@ int ChannelAttached2Pin[16]= {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1};
|
||||
uint32_t Hal::_analogWriteRange = 255;
|
||||
uint32_t Hal::_analogWriteFreq = 1000;
|
||||
|
||||
//Contructor
|
||||
Hal::Hal()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//Destructor
|
||||
Hal::~Hal()
|
||||
{
|
||||
}
|
||||
|
||||
void Hal::clearAnalogChannels()
|
||||
{
|
||||
#ifdef ARDUINO_ARCH_ESP32
|
||||
|
@ -35,8 +35,6 @@
|
||||
class Hal
|
||||
{
|
||||
public:
|
||||
Hal();
|
||||
~Hal();
|
||||
static bool begin();
|
||||
static void end();
|
||||
static void wait (uint32_t milliseconds);
|
||||
|
@ -174,13 +174,6 @@ const uint8_t DEFAULT_ADDRESS_VALUE[] = {0, 0, 0, 0};
|
||||
uint8_t Settings_ESP3D::_FirmwareTarget = UNKNOWN_FW;
|
||||
bool Settings_ESP3D::_SDdevice = ESP_NO_SD;
|
||||
|
||||
Settings_ESP3D::Settings_ESP3D()
|
||||
{
|
||||
}
|
||||
Settings_ESP3D::~Settings_ESP3D()
|
||||
{
|
||||
}
|
||||
|
||||
bool Settings_ESP3D::begin()
|
||||
{
|
||||
if(GetSettingsVersion() == -1) {
|
||||
|
@ -102,8 +102,6 @@
|
||||
class Settings_ESP3D
|
||||
{
|
||||
public:
|
||||
Settings_ESP3D();
|
||||
~Settings_ESP3D();
|
||||
static bool begin();
|
||||
static uint8_t get_default_byte_value(int pos);
|
||||
static uint32_t get_default_int32_value(int pos);
|
||||
|
@ -47,16 +47,6 @@ uint8_t AuthenticationService::_current_nb_ip = 0;
|
||||
#define MAX_AUTH_IP 10
|
||||
//#define ALLOW_MULTIPLE_SESSIONS
|
||||
|
||||
AuthenticationService::AuthenticationService()
|
||||
{
|
||||
}
|
||||
AuthenticationService::~AuthenticationService()
|
||||
{
|
||||
#if defined (HTTP_FEATURE) && defined (AUTHENTICATION_FEATURE)
|
||||
end();
|
||||
#endif //HTTP_FEATURE && AUTHENTICATION_FEATURE
|
||||
}
|
||||
|
||||
//check authentification
|
||||
level_authenticate_type AuthenticationService::authenticated_level(const char * pwd)
|
||||
{
|
||||
|
@ -58,8 +58,6 @@ typedef void Authwebserver;
|
||||
class AuthenticationService
|
||||
{
|
||||
public:
|
||||
AuthenticationService();
|
||||
~AuthenticationService();
|
||||
static level_authenticate_type authenticated_level(const char * pwd = nullptr);
|
||||
#ifdef AUTHENTICATION_FEATURE
|
||||
static bool begin(Authwebserver * webserver);
|
||||
|
@ -45,14 +45,6 @@
|
||||
|
||||
bool DevicesServices::_started = false;
|
||||
|
||||
DevicesServices::DevicesServices()
|
||||
{
|
||||
}
|
||||
DevicesServices::~DevicesServices()
|
||||
{
|
||||
end();
|
||||
}
|
||||
|
||||
bool DevicesServices::begin()
|
||||
{
|
||||
bool res = true;
|
||||
|
@ -27,8 +27,6 @@
|
||||
class DevicesServices
|
||||
{
|
||||
public:
|
||||
DevicesServices();
|
||||
~DevicesServices();
|
||||
static bool begin();
|
||||
static void end();
|
||||
static void handle();
|
||||
|
@ -32,14 +32,6 @@
|
||||
#include "ethconfig.h"
|
||||
bool EthConfig::_started = false;
|
||||
const uint8_t DEFAULT_AP_MASK_VALUE[] = {255, 255, 255, 0};
|
||||
EthConfig::EthConfig()
|
||||
{
|
||||
}
|
||||
|
||||
EthConfig::~EthConfig()
|
||||
{
|
||||
end();
|
||||
}
|
||||
|
||||
bool EthConfig::StartSTA()
|
||||
{
|
||||
|
@ -32,8 +32,6 @@
|
||||
class EthConfig
|
||||
{
|
||||
public:
|
||||
EthConfig();
|
||||
~EthConfig();
|
||||
static bool begin();
|
||||
static bool StartSTA();
|
||||
//static bool StartSRV();
|
||||
|
@ -31,16 +31,6 @@ File tFile_handle[ESP_MAX_OPENHANDLE];
|
||||
|
||||
bool ESP_FileSystem::_started = false;
|
||||
|
||||
//constructor
|
||||
ESP_FileSystem::ESP_FileSystem()
|
||||
{
|
||||
}
|
||||
|
||||
//destructor
|
||||
ESP_FileSystem::~ESP_FileSystem()
|
||||
{
|
||||
}
|
||||
|
||||
//helper to format size to readable string
|
||||
String & ESP_FileSystem::formatBytes (uint64_t bytes)
|
||||
{
|
||||
|
@ -65,8 +65,6 @@ class ESP_FileSystem
|
||||
{
|
||||
public:
|
||||
static String & formatBytes (uint64_t bytes);
|
||||
ESP_FileSystem();
|
||||
~ESP_FileSystem();
|
||||
static bool begin();
|
||||
static void end();
|
||||
static size_t totalBytes();
|
||||
|
@ -42,16 +42,6 @@ bool ESP_GBFS::isavailable(uint8_t FS)
|
||||
|
||||
uint8_t ESP_GBFS::_nbFS = 0;
|
||||
String ESP_GBFS::_rootlist[MAX_FS];
|
||||
//constructor
|
||||
ESP_GBFS::ESP_GBFS()
|
||||
{
|
||||
_nbFS = 0;
|
||||
}
|
||||
|
||||
//destructor
|
||||
ESP_GBFS::~ESP_GBFS()
|
||||
{
|
||||
}
|
||||
|
||||
//helper to format size to readable string
|
||||
String & ESP_GBFS::formatBytes (uint64_t bytes)
|
||||
|
@ -80,8 +80,6 @@ private:
|
||||
class ESP_GBFS
|
||||
{
|
||||
public:
|
||||
ESP_GBFS();
|
||||
~ESP_GBFS();
|
||||
static bool isavailable(uint8_t FS);
|
||||
static uint64_t totalBytes(uint8_t FS);
|
||||
static uint64_t usedBytes(uint8_t FS);
|
||||
|
@ -49,16 +49,6 @@ uint8_t ESP_SD::setState(uint8_t flag)
|
||||
}
|
||||
|
||||
|
||||
//constructor
|
||||
ESP_SD::ESP_SD()
|
||||
{
|
||||
}
|
||||
|
||||
//destructor
|
||||
ESP_SD::~ESP_SD()
|
||||
{
|
||||
}
|
||||
|
||||
void ESP_SD::handle()
|
||||
{
|
||||
|
||||
|
@ -66,8 +66,6 @@ class ESP_SD
|
||||
{
|
||||
public:
|
||||
static String & formatBytes (uint64_t bytes);
|
||||
ESP_SD();
|
||||
~ESP_SD();
|
||||
static bool begin();
|
||||
static void handle();
|
||||
static void end();
|
||||
|
@ -42,14 +42,6 @@ uint16_t HTTP_Server::_port = 0;
|
||||
WEBSERVER * HTTP_Server::_webserver = nullptr;
|
||||
uint8_t HTTP_Server::_upload_status = UPLOAD_STATUS_NONE;
|
||||
|
||||
HTTP_Server::HTTP_Server()
|
||||
{
|
||||
}
|
||||
HTTP_Server::~HTTP_Server()
|
||||
{
|
||||
end();
|
||||
}
|
||||
|
||||
void HTTP_Server::init_handlers()
|
||||
{
|
||||
_webserver->on("/",HTTP_ANY, handle_root);
|
||||
|
@ -45,8 +45,6 @@ typedef enum {
|
||||
class HTTP_Server
|
||||
{
|
||||
public:
|
||||
HTTP_Server();
|
||||
~HTTP_Server();
|
||||
static bool begin();
|
||||
static void end();
|
||||
static void handle();
|
||||
|
@ -49,14 +49,6 @@ bool NetConfig::_needReconnect2AP = false;
|
||||
bool NetConfig::_events_registered = false;
|
||||
bool NetConfig::_started = false;
|
||||
uint8_t NetConfig::_mode = ESP_RADIO_OFF;
|
||||
NetConfig::NetConfig()
|
||||
{
|
||||
}
|
||||
|
||||
NetConfig::~NetConfig()
|
||||
{
|
||||
//end();
|
||||
}
|
||||
|
||||
//just simple helper to convert mac address to string
|
||||
char * NetConfig::mac2str (uint8_t mac [8])
|
||||
|
@ -57,8 +57,6 @@
|
||||
class NetConfig
|
||||
{
|
||||
public:
|
||||
NetConfig();
|
||||
~NetConfig();
|
||||
static bool isValidIP(const char * string);
|
||||
static bool isHostnameValid (const char * hostname);
|
||||
static uint32_t IP_int_from_string(const char * s);
|
||||
|
@ -74,13 +74,6 @@ DNSServer dnsServer;
|
||||
#endif //CAMERA_DEVICE
|
||||
bool NetServices::_started = false;
|
||||
bool NetServices::_restart = false;
|
||||
NetServices::NetServices()
|
||||
{
|
||||
}
|
||||
NetServices::~NetServices()
|
||||
{
|
||||
end();
|
||||
}
|
||||
|
||||
bool NetServices::begin()
|
||||
{
|
||||
|
@ -27,8 +27,6 @@
|
||||
class NetServices
|
||||
{
|
||||
public:
|
||||
NetServices();
|
||||
~NetServices();
|
||||
static bool begin();
|
||||
static void end();
|
||||
static void handle();
|
||||
|
@ -32,14 +32,6 @@
|
||||
|
||||
const uint8_t DEFAULT_AP_MASK_VALUE[] = {255, 255, 255, 0};
|
||||
|
||||
WiFiConfig::WiFiConfig()
|
||||
{
|
||||
}
|
||||
|
||||
WiFiConfig::~WiFiConfig()
|
||||
{
|
||||
end();
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if SSID string is valid
|
||||
|
@ -53,8 +53,6 @@
|
||||
class WiFiConfig
|
||||
{
|
||||
public:
|
||||
WiFiConfig();
|
||||
~WiFiConfig();
|
||||
static bool isPasswordValid (const char * password);
|
||||
static bool isSSIDValid (const char * ssid);
|
||||
static bool StartAP();
|
||||
|
Loading…
x
Reference in New Issue
Block a user