| 33 | } |
| 34 | |
| 35 | void 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 | } |
no test coverage detected