Struct Peer

Source
pub struct Peer<T: GattTypes> { /* private fields */ }
Expand description

Connected scan delegator peer. Clients can use this object to perform Broadcast Audio Scan Service operations on the scan delegator peer. Not thread-safe and only one operation must be done at a time.

Implementations§

Source§

impl<T: GattTypes> Peer<T>

Source

pub fn peer_id(&self) -> PeerId

Source

pub fn take_event_stream( &mut self, ) -> Result<impl Stream<Item = Result<BassEvent, BassClientError>> + FusedStream, Error>

Takes event stream for BASS events from this scan delegator peer. Clients can call this method to start subscribing to BASS events.

Source

pub async fn send_broadcast_code( &self, broadcast_id: BroadcastId, broadcast_code: [u8; 16], ) -> Result<(), Error>

Send broadcast code for a particular broadcast.

Source

pub async fn add_broadcast_source( &self, source_peer_id: PeerId, address_lookup: &impl GetPeerAddr, pa_sync: PaSync, bis_sync: HashMap<u8, BisSync>, ) -> Result<(), Error>

Sends a command to add a particular broadcast source.

§Arguments
  • broadcast_source_pid - peer id of the braodcast source that’s to be added to this scan delegator peer
  • address_lookup - An implementation of [GetPeerAddr] that will be used to look up the peer’s address.
  • pa_sync - pa sync mode the peer should attempt to be in
  • bis_sync - desired BIG to BIS synchronization information. If the set is empty, no preference value is used for all the BIGs
Source

pub async fn update_broadcast_source_sync( &self, broadcast_id: BroadcastId, pa_sync: PaSync, bis_sync: HashMap<u8, BisSync>, ) -> Result<(), Error>

Sends a command to to update a particular broadcast source’s PA sync.

§Arguments
  • broadcast_id - broadcast id of the broadcast source that’s to be updated
  • pa_sync - pa sync mode the scan delegator peer should attempt to be in.
  • bis_sync - desired BIG to BIS synchronization information
Source

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

Sends a command to remove a particular broadcast source.

§Arguments
  • broadcast_id - broadcast id of the braodcast source that’s to be removed from the scan delegator
Source

pub async fn inform_remote_scan_started(&self) -> Result<(), Error>

Sends a command to inform the scan delegator peer that we have started scanning for broadcast sources on behalf of it.

Source

pub async fn inform_remote_scan_stopped(&self) -> Result<(), Error>

Sends a command to inform the scan delegator peer that we have stopped scanning for broadcast sources on behalf of it.

Source

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

Returns a list of BRS characteristics’ latest values the scan delegator has received.

Auto Trait Implementations§

§

impl<T> !Freeze for Peer<T>

§

impl<T> !RefUnwindSafe for Peer<T>

§

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

§

impl<T> !Sync for Peer<T>

§

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

§

impl<T> !UnwindSafe for Peer<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.