MCPcopy Create free account
hub / github.com/TactilityProject/Tactility / putString

Method putString

Tactility/Source/PreferencesEsp.cpp:131–143  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

129}
130
131void Preferences::putString(const std::string& key, const std::string& text) {
132 nvs_handle_t handle;
133 if (nvs_open(namespace_, NVS_READWRITE, &handle) == ESP_OK) {
134 if (nvs_set_str(handle, key.c_str(), text.c_str()) != ESP_OK) {
135 LOGGER.error("Failed to set {}:{}", namespace_, key.c_str());
136 } else if (nvs_commit(handle) != ESP_OK) {
137 LOGGER.error("Failed to commit {}:{}", namespace_, key);
138 }
139 nvs_close(handle);
140 } else {
141 LOGGER.error("Failed to open namespace {}", namespace_);
142 }
143}
144
145} // namespace
146

Callers 15

setTimeZoneFunction · 0.45
startFunction · 0.45
startFunction · 0.45
setResultNameFunction · 0.45
setResultCodeFunction · 0.45
toBundleFunction · 0.45
startFunction · 0.45
startFunction · 0.45
FileSelectionMethod · 0.45
startFunction · 0.45
startFunction · 0.45
startFunction · 0.45

Calls 1

errorMethod · 0.80

Tested by

no test coverage detected