This commit is contained in:
George Ruinelli
2022-10-21 21:33:05 +02:00
parent 46daa4cb79
commit 4f305a8705
7 changed files with 116 additions and 111 deletions

View File

@@ -10,7 +10,9 @@
#include <sstream>
#include <iostream>
#include <string.h>
#include "esp_log.h"
static const char *TAG = "read_wlanini";
std::vector<string> ZerlegeZeileWLAN(std::string input, std::string _delimiter = "")
{
@@ -55,7 +57,7 @@ void LoadWlanFromFile(std::string fn, char *&_ssid, char *&_password, char *&_ho
fn = FormatFileName(fn);
pFile = OpenFileAndWait(fn.c_str(), "r");
printf("file loaded\n");
ESP_LOGD(TAG, "file loaded");
if (pFile == NULL)
return;
@@ -66,7 +68,7 @@ void LoadWlanFromFile(std::string fn, char *&_ssid, char *&_password, char *&_ho
while ((line.size() > 0) || !(feof(pFile)))
{
// printf("%s", line.c_str());
// ESP_LOGD(TAG, "%s", line.c_str());
zerlegt = ZerlegeZeileWLAN(line, "=");
zerlegt[0] = trim(zerlegt[0], " ");
@@ -198,7 +200,7 @@ bool ChangeHostName(std::string fn, std::string _newhostname)
fn = FormatFileName(fn);
pFile = OpenFileAndWait(fn.c_str(), "r");
printf("file loaded\n");
ESP_LOGD(TAG, "file loaded\n");
if (pFile == NULL)
return false;
@@ -248,7 +250,7 @@ bool ChangeHostName(std::string fn, std::string _newhostname)
fclose(pFile);
printf("*** Hostname update done ***\n");
ESP_LOGD(TAG, "*** Hostname update done ***");
return true;
}