Struct BroadcastAudioScanServiceClient

Source
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>

Source

pub fn create_for_test( gatt_client: T::PeerService, audio_scan_control_point: Handle, ) -> Self

Source

pub async fn create(gatt_client: T::PeerService) -> Result<Self, Error>
where <T as GattTypes>::NotificationStream: Send,

Source

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.

Source

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.

Source

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.

Source

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.

Source

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 modify
  • pa_sync - pa sync mode the scan delegator peer should attempt to be in
  • pa_interval - updated PA interval value. If none, unknown value is used
  • bis_sync - desired BIG to BIS synchronization information. If empty, it’s not updated
  • metadata_map - map of updated metadata for BIGs. If a mapping does not exist for a BIG, that BIG’s metadata is not updated
Source

pub async fn remove_broadcast_source( &self, broadcast_id: BroadcastId, ) -> Result<(), Error>

Source

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.

Source

pub fn known_broadcast_sources(&self) -> Vec<(Handle, BroadcastReceiveState)>

Returns a list of currently known broadcast sources at the time this method was called.

Source

pub fn insert_broadcast_receive_state( &mut self, handle: Handle, brs: BroadcastReceiveState, )

Auto Trait Implementations§

§

impl<T> !Freeze for BroadcastAudioScanServiceClient<T>

§

impl<T> !RefUnwindSafe for BroadcastAudioScanServiceClient<T>

§

impl<T> Send for BroadcastAudioScanServiceClient<T>
where <T as GattTypes>::PeerService: Send,

§

impl<T> !Sync for BroadcastAudioScanServiceClient<T>

§

impl<T> Unpin for BroadcastAudioScanServiceClient<T>
where <T as GattTypes>::PeerService: Unpin,

§

impl<T> !UnwindSafe for BroadcastAudioScanServiceClient<T>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.