pub struct BroadcastAudioScanServiceClient<T: GattTypes> { /* private fields */ }
Expand description
Manages connection to the Broadcast Audio Scan Service at the remote Scan Delegator and writes/reads characteristics to/from it.
Implementations§
Source§impl<T: GattTypes> BroadcastAudioScanServiceClient<T>
impl<T: GattTypes> BroadcastAudioScanServiceClient<T>
pub fn create_for_test( gatt_client: T::PeerService, audio_scan_control_point: Handle, ) -> Self
pub async fn create(gatt_client: T::PeerService) -> Result<Self, Error>where
<T as GattTypes>::NotificationStream: Send,
Sourcepub fn take_event_stream(
&mut self,
) -> Option<impl Stream<Item = Result<Event, Error>> + FusedStream>
pub fn take_event_stream( &mut self, ) -> Option<impl Stream<Item = Result<Event, Error>> + FusedStream>
Returns a stream that can be used by the upper layer to poll for BroadcastAudioScanServiceEvent. BroadcastAudioScanServiceEvents are generated based on BRS characteristic change received from GATT notification that are processed by BroadcastAudioScanServiceClient. This method should only be called once. Returns an error if the method is called for a second time.
Sourcepub async fn remote_scan_started(&self) -> Result<(), Error>
pub async fn remote_scan_started(&self) -> Result<(), Error>
Indicates to the remote BASS server that we have started scanning for broadcast sources on behalf of it. If the scan delegator that serves the BASS server is collocated with a broadcast sink, this may or may not change the scanning behaviour of the the broadcast sink.
Sourcepub async fn remote_scan_stopped(&self) -> Result<(), Error>
pub async fn remote_scan_stopped(&self) -> Result<(), Error>
Indicates to the remote BASS server that we have stopped scanning for broadcast sources on behalf of it.
Sourcepub async fn add_broadcast_source(
&self,
broadcast_id: BroadcastId,
address_type: AddressType,
advertiser_address: [u8; 6],
sid: AdvertisingSetId,
pa_sync: PaSync,
pa_interval: PaInterval,
subgroups: Vec<BigSubgroup>,
) -> Result<(), Error>
pub async fn add_broadcast_source( &self, broadcast_id: BroadcastId, address_type: AddressType, advertiser_address: [u8; 6], sid: AdvertisingSetId, pa_sync: PaSync, pa_interval: PaInterval, subgroups: Vec<BigSubgroup>, ) -> Result<(), Error>
Provides the BASS server with information regarding a Broadcast Source.
Sourcepub async fn modify_broadcast_source(
&self,
broadcast_id: BroadcastId,
pa_sync: PaSync,
pa_interval: Option<PaInterval>,
bis_sync: Option<HashMap<SubgroupIndex, BisSync>>,
metadata_map: Option<HashMap<SubgroupIndex, Vec<Metadata>>>,
) -> Result<(), Error>
pub async fn modify_broadcast_source( &self, broadcast_id: BroadcastId, pa_sync: PaSync, pa_interval: Option<PaInterval>, bis_sync: Option<HashMap<SubgroupIndex, BisSync>>, metadata_map: Option<HashMap<SubgroupIndex, Vec<Metadata>>>, ) -> Result<(), Error>
Requests the BASS server to add or update Metadata for the Broadcast Source, and/or to request the server to synchronize to, or to stop synchronization to, a PA and/or a BIS.
§Arguments
broadcast_id
- id of the broadcast source to modifypa_sync
- pa sync mode the scan delegator peer should attempt to be inpa_interval
- updated PA interval value. If none, unknown value is usedbis_sync
- desired BIG to BIS synchronization information. If empty, it’s not updatedmetadata_map
- map of updated metadata for BIGs. If a mapping does not exist for a BIG, that BIG’s metadata is not updated
pub async fn remove_broadcast_source( &self, broadcast_id: BroadcastId, ) -> Result<(), Error>
Sourcepub async fn set_broadcast_code(
&self,
broadcast_id: BroadcastId,
broadcast_code: [u8; 16],
) -> Result<(), Error>
pub async fn set_broadcast_code( &self, broadcast_id: BroadcastId, broadcast_code: [u8; 16], ) -> Result<(), Error>
Sets the broadcast code for a particular broadcast stream.
Sourcepub fn known_broadcast_sources(&self) -> Vec<(Handle, BroadcastReceiveState)>
pub fn known_broadcast_sources(&self) -> Vec<(Handle, BroadcastReceiveState)>
Returns a list of currently known broadcast sources at the time this method was called.