async fn on_connection_request(
        &mut self,
        _protocol: Vec<ProtocolDescriptor>,
        channel: fuchsia_bluetooth::types::Channel,
    ) -> Result<(), Error> {
        if self.connection.connected() {
            info!("Overwriting existing connection to {}", self.id);
        } else {
            info!("Connection request from {}", self.id);
        }
        self.connection.connect(channel);
        if let Some(id) = self.manager_id {
            self.notify_peer_connected(id).await;
            self.setup_handler().await?;
        }
        Ok(())
    }
/// Always give preference to connection requests received from the peer device.
Always give preference to connection requests received from the peer device.
Always give preference to connection requests received from the peer device .
async fn on_connection_request(
        &mut self,
        _protocol: Vec<ProtocolDescriptor>,
        channel: fuchsia_bluetooth::types::Channel,
    ) -> Result<(), Error> {
        if self.connection.connected() {
            info!("Overwriting existing connection to {}", self.id);
        } else {
            info!("Connection request from {}", self.id);
        }
        self.connection.connect(channel);
        if let Some(id) = self.manager_id {
            self.notify_peer_connected(id).await;
            self.setup_handler().await?;
        }
        Ok(())
    }
async fn on_connection_request ( & mut self , _protocol : Vec < ProtocolDescriptor > , channel : fuchsia_bluetooth :: types :: Channel , ) -> Result < ( ) , Error > { if self . connection . connected ( ) { info ! ( " " self id ) ; } else { info ! ( " " self id ) ; } self . connection . connect ( channel ) ; if let Some ( id ) = self . manager_id { self . notify_peer_connected ( id ) . await ; self . setup_handler ( ) . await ? ; } Ok ( ( ) ) }
Always give preference to connection requests received from the peer device.
Always give preference to connection requests received from the peer device .
&mut self
_protocol
Vec<ProtocolDescriptor>
channel
fuchsia_bluetooth::types::Channel
&mut self
_protocol
Vec<ProtocolDescriptor>
channel
fuchsia_bluetooth::types::Channel