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>
impl<T: GattTypes> Peer<T>
pub fn peer_id(&self) -> PeerId
Sourcepub fn take_event_stream(
&mut self,
) -> Result<impl Stream<Item = Result<BassEvent, BassClientError>> + FusedStream, Error>
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.
Sourcepub async fn send_broadcast_code(
&self,
broadcast_id: BroadcastId,
broadcast_code: [u8; 16],
) -> Result<(), Error>
pub async fn send_broadcast_code( &self, broadcast_id: BroadcastId, broadcast_code: [u8; 16], ) -> Result<(), Error>
Send broadcast code for a particular broadcast.
Sourcepub async fn add_broadcast_source(
&self,
source_peer_id: PeerId,
address_lookup: &impl GetPeerAddr,
pa_sync: PaSync,
bis_sync: HashMap<u8, BisSync>,
) -> Result<(), Error>
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 peeraddress_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 inbis_sync
- desired BIG to BIS synchronization information. If the set is empty, no preference value is used for all the BIGs
Sourcepub async fn update_broadcast_source_sync(
&self,
broadcast_id: BroadcastId,
pa_sync: PaSync,
bis_sync: HashMap<u8, BisSync>,
) -> Result<(), Error>
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 updatedpa_sync
- pa sync mode the scan delegator peer should attempt to be in.bis_sync
- desired BIG to BIS synchronization information
Sourcepub async fn remove_broadcast_source(
&self,
broadcast_id: BroadcastId,
) -> Result<(), Error>
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
Sourcepub async fn inform_remote_scan_started(&self) -> Result<(), Error>
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.
Sourcepub async fn inform_remote_scan_stopped(&self) -> Result<(), Error>
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.
Sourcepub fn get_broadcast_receive_states(
&self,
) -> Vec<(Handle, BroadcastReceiveState)>
pub fn get_broadcast_receive_states( &self, ) -> Vec<(Handle, BroadcastReceiveState)>
Returns a list of BRS characteristics’ latest values the scan delegator has received.