blob: a89532d54aad00a9b936c1bbf69f817c816ea86e [file]
// Copyright 2026 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
use bt_common::PeerId;
use bt_gatt::GattTypes;
use crate::types::{Error, SupportedCapabilities};
/// Represents a connection to a single peer and manages its audio streams.
pub struct BapUnicastClient<T: GattTypes> {
peer_id: PeerId,
#[allow(unused)]
gatt_client: T::Client,
// TODO: Add ASCS and PACS clients here.
}
impl<T: GattTypes> BapUnicastClient<T> {
pub fn new(peer_id: PeerId, gatt_client: T::Client) -> Self {
Self { peer_id, gatt_client }
}
pub fn peer_id(&self) -> PeerId {
self.peer_id
}
/// Discovers PACS and ASCS and returns supported configurations.
pub async fn discover(&mut self) -> Result<SupportedCapabilities, Error> {
// TODO: Implement actual discovery.
// Using dummy data for now to trigger skeleton mapping logic.
let pac_records = vec![bt_pacs::PacRecord {
codec_id: bt_common::core::CodecId::Assigned(bt_common::core::CodingFormat::Lc3),
codec_specific_capabilities: vec![],
metadata: vec![],
}];
let sink_ase_count = 1;
let source_ase_count = 1;
Ok(crate::mapping::map_capabilities(&pac_records, sink_ase_count, source_ase_count))
}
}