Integrate companion-chip status into GET /api/health (fw 0.6.0).
Expose Si4684, ADAU1701, and BT1035 boot flags via CompanionChipStatus after HardwareBootstrap; update API manual schema for Slice 8. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
/**
|
||||
* @file CompanionChipStatus.hpp
|
||||
* @brief Boot-ready flags for Si4684, ADAU1701, and FSC-BT1035.
|
||||
*
|
||||
* 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 CompanionChipStatus — companion-chip boot snapshot for /api/health.
|
||||
*
|
||||
* @dname CompanionChipStatus
|
||||
* @return n/a (type)
|
||||
* @pubstate Immutable aggregate; all true after successful HardwareBootstrap.
|
||||
*
|
||||
* @author Michele Bigi
|
||||
* @date 2026-07-06
|
||||
*/
|
||||
struct CompanionChipStatus {
|
||||
bool si4684Ready; ///< Si4684 HOST_LOAD completed.
|
||||
bool adau1701Ready; ///< ADAU1701 SigmaStudio download completed.
|
||||
bool bt1035Ready; ///< BT1035 Line-In init (AT+AUXCFG=1) completed.
|
||||
};
|
||||
|
||||
} // namespace core
|
||||
@@ -18,6 +18,9 @@
|
||||
#pragma once
|
||||
|
||||
#include "core/FirmwareVersion.hpp"
|
||||
#include "core/CompanionChipStatus.hpp"
|
||||
|
||||
#include <optional>
|
||||
|
||||
namespace core {
|
||||
|
||||
@@ -64,6 +67,21 @@ public:
|
||||
*/
|
||||
[[nodiscard]] static HealthStatus ok(FirmwareVersion firmware);
|
||||
|
||||
/**
|
||||
* @brief ok — build health response including companion-chip flags.
|
||||
*
|
||||
* @dname ok
|
||||
* @param firmware Active firmware version to report.
|
||||
* @param chips Si4684 / ADAU1701 / BT1035 boot snapshot.
|
||||
* @return HealthStatus with HealthState::Ok and chips populated.
|
||||
* @pubstate none
|
||||
*
|
||||
* @author Michele Bigi
|
||||
* @date 2026-07-06
|
||||
*/
|
||||
[[nodiscard]] static HealthStatus ok(FirmwareVersion firmware,
|
||||
CompanionChipStatus chips);
|
||||
|
||||
/**
|
||||
* @brief state — read the health indicator.
|
||||
*
|
||||
@@ -88,11 +106,28 @@ public:
|
||||
*/
|
||||
[[nodiscard]] const FirmwareVersion& firmware() const noexcept;
|
||||
|
||||
/**
|
||||
* @brief chips — optional companion-chip boot flags.
|
||||
*
|
||||
* @dname chips
|
||||
* @return Chip status when set by ok(..., chips); otherwise nullopt.
|
||||
* @pubstate reads chips_.
|
||||
*
|
||||
* @author Michele Bigi
|
||||
* @date 2026-07-06
|
||||
*/
|
||||
[[nodiscard]] const std::optional<CompanionChipStatus>& chips() const
|
||||
noexcept;
|
||||
|
||||
private:
|
||||
explicit HealthStatus(HealthState state, FirmwareVersion firmware);
|
||||
|
||||
explicit HealthStatus(HealthState state, FirmwareVersion firmware,
|
||||
CompanionChipStatus chips);
|
||||
|
||||
HealthState state_;
|
||||
FirmwareVersion firmware_;
|
||||
std::optional<CompanionChipStatus> chips_;
|
||||
};
|
||||
|
||||
} // namespace core
|
||||
|
||||
Reference in New Issue
Block a user