Why this example work:
#include <IniFile.h>
void setup()
{
const size_t bufferLen = 80;
char buffer[bufferLen];
IniFile ini("nazwapliku");
ini.getValue("network", "mac", buffer, bufferLen);
}
void loop()
{
}
and this doesn't work:
#include <IniFile.h>
void setup()
{
const size_t bufferLen = 80;
char buffer[bufferLen];
String fName = "nazwapliku";
IniFile ini(fName);
ini.getValue("network", "mac", buffer, bufferLen);
}
void loop()
{
}
and this one doesn't, how to use here variable instead of string in ""?
When I try to compile second one then I got error message:
Compiling debug version of 'IniFileExample' for 'Arduino/Genuino Uno'
IniFileExample.ino: In function void setup()
Error compiling project sources
Debug build failed for project 'IniFileExample'
IniFileExample.ino: 10:18: error: no matching function for call to 'IniFile::IniFile(String&)
IniFile ini(fName)
IniFileExample.ino:10: note candidates are
IniFileExample.ino: In file included from
IniFile.h:30: note IniFile IniFile(const char*, uint8_t, bool)
IniFile(const char* filename, uint8_t mode = FILE_READ
IniFile.h:30: note no known conversion for argument 1 from String to const char*
IniFile.h:13: note constexpr IniFile IniFile(const IniFile&)
class IniFile {
IniFile.h:13: note no known conversion for argument 1 from String to const IniFile&
If this can help in any way than I use this library -> GitHub - stevemarple/IniFile: Arduino library to parse ini files.