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
@@ -38,7 +38,6 @@ public:
* @brief reset — discard accumulated DLS segments.
*
* @dname reset
* @return n/a
* @pubstate clears buffer and segment flags.
*
* @author Michele Bigi
@@ -53,7 +52,6 @@ public:
* @param segmentIndex Zero-based segment index from the chip.
* @param segmentCount Total segments advertised for this label.
* @param payload Raw UTF-8 bytes for this segment.
* @return n/a
* @pubstate copies payload into buffer_ at the computed offset.
*
* @author Michele Bigi
@@ -20,6 +20,7 @@
#include "core/StoreError.hpp"
#include "core/WifiCredentials.hpp"
#include <cstdint>
#include <expected>
#include <string>
#include <string_view>
@@ -157,6 +158,58 @@ public:
*/
[[nodiscard]] virtual std::expected<void, StoreError>
clearStationList() = 0;
/**
* @brief hasLastPresetIndex — check whether a last-recalled preset exists.
*
* @dname hasLastPresetIndex
* @return true when loadLastPresetIndex would succeed.
* @pubstate reads backing storage via implementation.
*
* @author Michele Bigi
* @date 2026-07-06
*/
[[nodiscard]] virtual bool hasLastPresetIndex() const = 0;
/**
* @brief saveLastPresetIndex — persist the last recalled preset index.
*
* @dname saveLastPresetIndex
* @param index Zero-based preset list position (019).
* @return Ok on success, or StoreError::IoFailed.
* @pubstate writes backing storage via implementation.
*
* @author Michele Bigi
* @date 2026-07-06
*/
[[nodiscard]] virtual std::expected<void, StoreError>
saveLastPresetIndex(std::uint8_t index) = 0;
/**
* @brief loadLastPresetIndex — read the last recalled preset index.
*
* @dname loadLastPresetIndex
* @return Preset index on success, or StoreError.
* @pubstate reads backing storage via implementation.
*
* @author Michele Bigi
* @date 2026-07-06
*/
[[nodiscard]] virtual std::expected<std::uint8_t, StoreError>
loadLastPresetIndex() const = 0;
/**
* @brief clearLastPresetIndex — erase the last-recalled preset marker.
*
* @dname clearLastPresetIndex
* @return Ok on success, or StoreError::IoFailed.
* @pubstate clears backing storage via implementation.
*
* @author Michele Bigi
* @date 2026-07-06
*/
[[nodiscard]] virtual std::expected<void, StoreError>
clearLastPresetIndex() = 0;
};
} // namespace core
@@ -0,0 +1,34 @@
/**
* @file IntegrationError.hpp
* @brief Typed errors for application integration flows.
*
* DigiRadio firmware — https://github.com/manvalan/DigiRadio
*
* Copyright 2026 Michele Bigi
* SPDX-License-Identifier: Apache-2.0
*
* @author Michele Bigi
* @date 2026-07-06
*/
#pragma once
namespace core {
/**
* @brief IntegrationError — failure causes for preset recall orchestration.
*
* @dname IntegrationError
* @return n/a (type)
* @pubstate n/a
*
* @author Michele Bigi
* @date 2026-07-06
*/
enum class IntegrationError {
StoreFailed, ///< NVS load/save failed during startup or recall.
PresetNotFound, ///< Preset index out of range.
TuneFailed, ///< Tuner could not recall the preset target.
AudioFailed, ///< ADAU1701 profile could not be applied.
};
} // namespace core
@@ -36,7 +36,6 @@ public:
* @brief reset — clear accumulated PS and radiotext.
*
* @dname reset
* @return n/a
* @pubstate clears internal buffers.
*
* @author Michele Bigi
@@ -52,7 +51,6 @@ public:
* @param blockB RDS block B (group type and address).
* @param blockC RDS block C (text payload).
* @param blockD RDS block D (text payload for RT).
* @return n/a
* @pubstate updates PS/RT buffers for group types 0A and 2A.
*
* @author Michele Bigi