pub(crate) fn start(
        peer_id: PeerId,
        player_request_stream: sessions2::PlayerRequestStream,
    ) -> Result<fasync::Task<()>, Error> {
        let avrcp_svc =
            fuchsia_component::client::connect_to_protocol::<avrcp::PeerManagerMarker>()
                .context("Failed to connect to Bluetooth AVRCP interface")?;
        let battery_client = BatteryClient::create().ok().into();
        let session_fut =
            Self::session_relay(avrcp_svc, peer_id, player_request_stream, battery_client);
        Ok(fasync::Task::spawn(async move {
            if let Err(e) = session_fut.await {
                info!("Session completed with error: {:?}", e);
            }
        }))
    }
/// Start a relay between AVRCP and MediaSession.
/// A MediaSession is published with the information from the AVRCP target.
/// This starts the relay.  The relay can be stopped by dropping it.
Start a relay between AVRCP and MediaSession.
A MediaSession is published with the information from the AVRCP target.
This starts the relay.  The relay can be stopped by dropping it.
Start a relay between AVRCP and MediaSession . A MediaSession is published with the information from the AVRCP target . This starts the relay . The relay can be stopped by dropping it .
pub(crate) fn start(
        peer_id: PeerId,
        player_request_stream: sessions2::PlayerRequestStream,
    ) -> Result<fasync::Task<()>, Error> {
        let avrcp_svc =
            fuchsia_component::client::connect_to_protocol::<avrcp::PeerManagerMarker>()
                .context("Failed to connect to Bluetooth AVRCP interface")?;
        let battery_client = BatteryClient::create().ok().into();
        let session_fut =
            Self::session_relay(avrcp_svc, peer_id, player_request_stream, battery_client);
        Ok(fasync::Task::spawn(async move {
            if let Err(e) = session_fut.await {
                info!("Session completed with error: {:?}", e);
            }
        }))
    }
pub ( crate ) fn start ( peer_id : PeerId , player_request_stream : sessions2 :: PlayerRequestStream , ) -> Result < fasync :: Task < ( ) > , Error > { let avrcp_svc = fuchsia_component :: client :: connect_to_protocol :: < avrcp :: PeerManagerMarker > ( ) . context ( " " ) ? ; let battery_client = BatteryClient :: create ( ) . ok ( ) . into ( ) ; let session_fut = Self :: session_relay ( avrcp_svc , peer_id , player_request_stream , battery_client ) ; Ok ( fasync :: Task :: spawn ( async move { if let Err ( e ) = session_fut . await { info ! ( " " e ) ; } } ) ) }
Start a relay between AVRCP and MediaSession.
Start a relay between AVRCP and MediaSession .
peer_id
PeerId
player_request_stream
sessions2::PlayerRequestStream
peer_id
PeerId
player_request_stream
sessions2::PlayerRequestStream