| 115 | } |
| 116 | |
| 117 | void Preferences::putInt64(const std::string& key, int64_t value) { |
| 118 | nvs_handle_t handle; |
| 119 | if (nvs_open(namespace_, NVS_READWRITE, &handle) == ESP_OK) { |
| 120 | if (nvs_set_i64(handle, key.c_str(), value) != ESP_OK) { |
| 121 | LOGGER.error("Failed to set {}:{}", namespace_, key); |
| 122 | } else if (nvs_commit(handle) != ESP_OK) { |
| 123 | LOGGER.error("Failed to commit {}:{}", namespace_, key); |
| 124 | } |
| 125 | nvs_close(handle); |
| 126 | } else { |
| 127 | LOGGER.error("Failed to open namespace {}", namespace_); |
| 128 | } |
| 129 | } |
| 130 | |
| 131 | void Preferences::putString(const std::string& key, const std::string& text) { |
| 132 | nvs_handle_t handle; |