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

Method putBool

Tactility/Source/PreferencesEsp.cpp:89–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

87}
88
89void Preferences::putBool(const std::string& key, bool value) {
90 nvs_handle_t handle;
91 if (nvs_open(namespace_, NVS_READWRITE, &handle) == ESP_OK) {
92 if (nvs_set_u8(handle, key.c_str(), value) != ESP_OK) {
93 LOGGER.error("Failed to set {}:{}", namespace_, key);
94 } else if (nvs_commit(handle) != ESP_OK) {
95 LOGGER.error("Failed to commit {}:{}", namespace_, key);
96 }
97 nvs_close(handle);
98 } else {
99 LOGGER.error("Failed to open namespace {}", namespace_);
100 }
101}
102
103void Preferences::putInt32(const std::string& key, int32_t value) {
104 nvs_handle_t handle;

Callers 2

markCompletedFunction · 0.45
startFunction · 0.45

Calls 1

errorMethod · 0.80

Tested by

no test coverage detected