| 27 | } |
| 28 | |
| 29 | bool Preferences::optInt32(const std::string& key, int32_t& out) const { |
| 30 | nvs_handle_t handle; |
| 31 | if (nvs_open(namespace_, NVS_READWRITE, &handle) != ESP_OK) { |
| 32 | LOGGER.error("Failed to open namespace {}", namespace_); |
| 33 | return false; |
| 34 | } else { |
| 35 | bool success = nvs_get_i32(handle, key.c_str(), &out) == ESP_OK; |
| 36 | nvs_close(handle); |
| 37 | return success; |
| 38 | } |
| 39 | } |
| 40 | |
| 41 | bool Preferences::optInt64(const std::string& key, int64_t& out) const { |
| 42 | nvs_handle_t handle; |
no test coverage detected