| 101 | } |
| 102 | |
| 103 | void Preferences::putInt32(const std::string& key, int32_t value) { |
| 104 | nvs_handle_t handle; |
| 105 | if (nvs_open(namespace_, NVS_READWRITE, &handle) == ESP_OK) { |
| 106 | if (nvs_set_i32(handle, key.c_str(), value) != ESP_OK) { |
| 107 | LOGGER.error("Failed to set {}:{}", namespace_, key); |
| 108 | } else if (nvs_commit(handle) != ESP_OK) { |
| 109 | LOGGER.error("Failed to commit {}:{}", namespace_, key); |
| 110 | } |
| 111 | nvs_close(handle); |
| 112 | } else { |
| 113 | LOGGER.error("Failed to open namespace {}", namespace_); |
| 114 | } |
| 115 | } |
| 116 | |
| 117 | void Preferences::putInt64(const std::string& key, int64_t value) { |
| 118 | nvs_handle_t handle; |
no test coverage detected