MCPcopy Create free account
hub / github.com/SmingHub/Sming / saveConfig

Function saveConfig

samples/Basic_WebSkeletonApp_LTS/app/configuration.cpp:35–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33}
34
35void saveConfig(ThermConfig& cfg)
36{
37 StaticJsonBuffer<ConfigJsonBufferSize> jsonBuffer;
38 JsonObject& root = jsonBuffer.createObject();
39
40 JsonObject& network = jsonBuffer.createObject();
41 root["network"] = network;
42 network["StaSSID"] = cfg.StaSSID.c_str();
43 network["StaPassword"] = cfg.StaPassword.c_str();
44 network["StaEnable"] = cfg.StaEnable;
45
46 char buf[ConfigFileBufferSize];
47 root.prettyPrintTo(buf, sizeof(buf));
48 fileSetContent(THERM_CONFIG_FILE, buf);
49}

Callers 1

onConfigurationFunction · 0.70

Calls 2

fileSetContentFunction · 0.85
c_strMethod · 0.45

Tested by

no test coverage detected