| 39 | } |
| 40 | |
| 41 | bool Preferences::optInt64(const std::string& key, int64_t& out) const { |
| 42 | nvs_handle_t handle; |
| 43 | if (nvs_open(namespace_, NVS_READWRITE, &handle) != ESP_OK) { |
| 44 | LOGGER.error("Failed to open namespace {}", namespace_); |
| 45 | return false; |
| 46 | } else { |
| 47 | bool success = nvs_get_i64(handle, key.c_str(), &out) == ESP_OK; |
| 48 | nvs_close(handle); |
| 49 | return success; |
| 50 | } |
| 51 | } |
| 52 | |
| 53 | bool Preferences::optString(const std::string& key, std::string& out) const { |
| 54 | nvs_handle_t handle; |