Add integration startup service and fix Doxygen (fw 0.8.1).

Replace the services stub with IntegrationService for boot preset recall and tune orchestration, persist last preset in NVS, and remove invalid @return tags that broke CI on T4 metadata headers.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-07-07 00:17:13 +02:00
co-authored by Cursor
parent 0fc714e431
commit d13012ce4b
24 changed files with 858 additions and 92 deletions
@@ -31,6 +31,7 @@ constexpr char kNamespace[] = "digiradio";
constexpr char kSsidKey[] = "wifi_ssid";
constexpr char kPasswordKey[] = "wifi_pwd";
constexpr char kStationListKey[] = "station_list";
constexpr char kLastPresetKey[] = "last_preset";
} // namespace
bool NvsSecureStore::hasWifiCredentials() const
@@ -229,4 +230,75 @@ std::expected<void, core::StoreError> NvsSecureStore::clearStationList()
return {};
}
bool NvsSecureStore::hasLastPresetIndex() const
{
nvs_handle_t handle = 0;
if (nvs_open(kNamespace, NVS_READONLY, &handle) != ESP_OK) {
return false;
}
std::uint8_t value = 0U;
const esp_err_t err = nvs_get_u8(handle, kLastPresetKey, &value);
nvs_close(handle);
return err == ESP_OK;
}
std::expected<void, core::StoreError>
NvsSecureStore::saveLastPresetIndex(std::uint8_t index)
{
nvs_handle_t handle = 0;
if (nvs_open(kNamespace, NVS_READWRITE, &handle) != ESP_OK) {
return std::unexpected(core::StoreError::IoFailed);
}
esp_err_t err = nvs_set_u8(handle, kLastPresetKey, index);
if (err == ESP_OK) {
err = nvs_commit(handle);
}
nvs_close(handle);
if (err != ESP_OK) {
return std::unexpected(core::StoreError::IoFailed);
}
return {};
}
std::expected<std::uint8_t, core::StoreError>
NvsSecureStore::loadLastPresetIndex() const
{
nvs_handle_t handle = 0;
if (nvs_open(kNamespace, NVS_READONLY, &handle) != ESP_OK) {
return std::unexpected(core::StoreError::NotFound);
}
std::uint8_t value = 0U;
const esp_err_t err = nvs_get_u8(handle, kLastPresetKey, &value);
nvs_close(handle);
if (err != ESP_OK) {
return std::unexpected(core::StoreError::NotFound);
}
return value;
}
std::expected<void, core::StoreError> NvsSecureStore::clearLastPresetIndex()
{
nvs_handle_t handle = 0;
if (nvs_open(kNamespace, NVS_READWRITE, &handle) != ESP_OK) {
return std::unexpected(core::StoreError::IoFailed);
}
esp_err_t err = nvs_erase_key(handle, kLastPresetKey);
if (err == ESP_OK || err == ESP_ERR_NVS_NOT_FOUND) {
err = nvs_commit(handle);
}
nvs_close(handle);
if (err != ESP_OK && err != ESP_ERR_NVS_NOT_FOUND) {
return std::unexpected(core::StoreError::IoFailed);
}
return {};
}
} // namespace secure_store