/// Handles found services. Stores the found information and then spawns a task which will
/// assume initator role after a delay.
Handles found services. Stores the found information and then spawns a task which will
assume initator role after a delay.
Handles found services . Stores the found information and then spawns a task which will assume initator role after a delay .
fn handle_services_found(
    peer_id: &PeerId,
    attributes: &[Attribute],
    peers: Arc<Mutex<ConnectedPeers>>,
    controller_pool: Arc<Mutex<AvdtpControllerPool>>,
    profile_svc: ProfileProxy,
) {
    fx_log_info!("Audio Source found on {}, attributes: {:?}", peer_id, attributes);
    let profile = match find_profile_descriptors(attributes) {
        Ok(profiles) => profiles.into_iter().next().expect("at least one profile descriptor"),
        Err(_) => {
            fx_log_info!("Couldn't find profile in peer {} search results, ignoring.", peer_id);
            return;
        }
    };
    peers.lock().found(peer_id.clone(), profile);
    if peers.lock().is_connected(&peer_id) {
        return;
    }
    fasync::spawn(connect_after_timeout(
        peer_id.clone(),
        peers.clone(),
        controller_pool.clone(),
        profile_svc,
    ));
}
fn handle_services_found ( peer_id : & PeerId , attributes : & [ Attribute ] , peers : Arc < Mutex < ConnectedPeers > > , controller_pool : Arc < Mutex < AvdtpControllerPool > > , profile_svc : ProfileProxy , ) { fx_log_info ! ( " " peer_id attributes ) ; let profile = match find_profile_descriptors ( attributes ) { Ok ( profiles ) => profiles . into_iter ( ) . next ( ) . expect ( " " ) , Err ( _ ) => { fx_log_info ! ( " " peer_id ) ; return ; } } ; peers . lock ( ) . found ( peer_id . clone ( ) , profile ) ; if peers . lock ( ) . is_connected ( & peer_id ) { return ; } fasync :: spawn ( connect_after_timeout ( peer_id . clone ( ) , peers . clone ( ) , controller_pool . clone ( ) , profile_svc , ) ) ; }
Handles found services.
Handles found services .
peer_id
&PeerId
attributes
&[Attribute]
peers
Arc<Mutex<ConnectedPeers>>
controller_pool
Arc<Mutex<AvdtpControllerPool>>
profile_svc
ProfileProxy