Add Slice 4 tuner stack with AGENTS-compliant core types and HTTP API.
Introduces Si4684/ADAU1701 drivers, TunerService, FrequencyKHz, SeekDirection, /api/tuner routes without file-scope globals, host tests, and firmware blob tooling (binaries remain gitignored). Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -27,6 +27,10 @@
|
||||
#include <expected>
|
||||
#include <optional>
|
||||
|
||||
namespace tuner {
|
||||
class TunerService;
|
||||
} // namespace tuner
|
||||
|
||||
namespace net {
|
||||
|
||||
/**
|
||||
@@ -47,6 +51,7 @@ public:
|
||||
*
|
||||
* @dname start
|
||||
* @param store Secure store consulted for saved STA credentials.
|
||||
* @param tuner Tuner service exposed by the HTTP API.
|
||||
* @return NetBootstrap on success, or a NetError.
|
||||
* @pubstate none
|
||||
*
|
||||
@@ -54,7 +59,7 @@ public:
|
||||
* @date 2026-07-06
|
||||
*/
|
||||
[[nodiscard]] static std::expected<NetBootstrap, NetError>
|
||||
start(core::ISecureStore& store);
|
||||
start(core::ISecureStore& store, tuner::TunerService& tuner);
|
||||
|
||||
NetBootstrap(const NetBootstrap&) = delete;
|
||||
NetBootstrap& operator=(const NetBootstrap&) = delete;
|
||||
|
||||
@@ -23,10 +23,32 @@
|
||||
|
||||
#include <expected>
|
||||
|
||||
struct httpd_req;
|
||||
|
||||
namespace tuner {
|
||||
class TunerService;
|
||||
} // namespace tuner
|
||||
|
||||
struct httpd_handle;
|
||||
|
||||
namespace net {
|
||||
|
||||
/**
|
||||
* @brief HttpRouteContext — dependencies injected into HTTP handlers.
|
||||
*
|
||||
* @dname HttpRouteContext
|
||||
* @return n/a (type)
|
||||
* @pubstate Borrows store and tuner for the lifetime of SetupWebServer.
|
||||
* Passed as esp_http_server user_ctx (no file-scope globals).
|
||||
*
|
||||
* @author Michele Bigi
|
||||
* @date 2026-07-06
|
||||
*/
|
||||
struct HttpRouteContext {
|
||||
core::ISecureStore* store; ///< Secure store for Wi-Fi provisioning.
|
||||
tuner::TunerService* tuner; ///< Tuner service for tuner REST routes.
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief SetupWebServer — setup UI, health, and Wi-Fi provisioning API.
|
||||
*
|
||||
@@ -96,19 +118,23 @@ public:
|
||||
* @dname start
|
||||
* @param store Secure store for POST /api/wifi persistence.
|
||||
* @param netState Active network phase exposed to handlers.
|
||||
* @param tuner Tuner service for the tuner REST routes.
|
||||
* @return Ok on success, or NetError::HttpServerStartFailed.
|
||||
* @pubstate writes server_, store_, and netState_ on success.
|
||||
* @pubstate writes server_, store_, netState_, and tuner_ on success.
|
||||
*
|
||||
* @author Michele Bigi
|
||||
* @date 2026-07-06
|
||||
*/
|
||||
[[nodiscard]] std::expected<void, NetError> start(core::ISecureStore& store,
|
||||
NetState netState);
|
||||
NetState netState,
|
||||
tuner::TunerService& tuner);
|
||||
|
||||
private:
|
||||
httpd_handle* server_;
|
||||
core::ISecureStore* store_;
|
||||
NetState netState_;
|
||||
tuner::TunerService* tuner_;
|
||||
HttpRouteContext routeContext_;
|
||||
};
|
||||
|
||||
} // namespace net
|
||||
|
||||
Reference in New Issue
Block a user