ExchangeService class final
#include <control/exchange_service.hpp>
Transport-agnostic control exchange orchestrator.
This class is reentrant with caller-owned buffers. Single-flight is enforced by ExchangeGuard in dispatch().
Constructors, destructors, conversion operators
- ExchangeService(IClock& clock, const IDeviceIdentity& device_identity)
- Constructs service with mandatory shared dependencies.
Public functions
- auto dispatch(const ExchangeRequest& request, const ExchangeBuffers& buffers, ExchangeResponse* out_response) -> bool
- Processes one request and writes one response into caller buffers.
-
void set_bootstrap_service(const prf::
crypto:: IBootstrapService* bootstrap_service) - Injects bootstrap-mode state used by bootstrap install authentication.
- void set_commands(std::span<const CommandDescriptor> commands)
- Sets active command descriptor table view.
-
void set_key_service(prf::
crypto:: IKeyService* key_service) - Injects key service used for COSE verify/sign.
- void set_nonce_source(const IManagementNonceSource* nonce_source)
- Injects rotating nonce source used for signed-write freshness.
- void set_reboot_controller(ISystemRebootController* reboot_controller)
- Injects controller used by
/system/reboot. - void set_response_signing_policy(ResponseSigningPolicy policy)
- Sets response signing policy.
- void set_system_status_source(const ISystemStatusSource* system_status_source)
- Injects provider used by
/system/status.
Function documentation
bool prf:: control:: ExchangeService:: dispatch(const ExchangeRequest& request,
const ExchangeBuffers& buffers,
ExchangeResponse* out_response)
Processes one request and writes one response into caller buffers.
Returns false only on irrecoverable transport-level failure (for example null output pointer or invalid buffer contract). Logical/business errors are returned in out_response with ok=false and error_code.