/// Create a new Profile that advertises the services in `services`.
/// Incoming connections will request the `channel mode` provided.
Create a new Profile that advertises the services in `services`.
Incoming connections will request the `channel mode` provided.
Create a new Profile that advertises the services in ` services ` . Incoming connections will request the ` channel mode ` provided .
pub fn advertise(
        proxy: bredr::ProfileProxy,
        services: &[bredr::ServiceDefinition],
        channel_mode: bredr::ChannelMode,
    ) -> Result<Self, Error> {
        if services.is_empty() {
            return Ok(Self::new(proxy));
        }
        let (connect_client, connection_receiver) = create_request_stream()?;
        let advertisement = proxy
            .advertise(
                &mut services.into_iter().cloned(),
                bredr::ChannelParameters {
                    channel_mode: Some(channel_mode),
                    ..bredr::ChannelParameters::EMPTY
                },
                connect_client,
            )
            .check()?;
        Ok(Self {
            proxy,
            advertisement: Some(advertisement),
            connection_receiver: Some(connection_receiver),
            searches: Vec::new(),
            terminated: false,
        })
    }
pub fn advertise ( proxy : bredr :: ProfileProxy , services : & [ bredr :: ServiceDefinition ] , channel_mode : bredr :: ChannelMode , ) -> Result < Self , Error > { if services . is_empty ( ) { return Ok ( Self :: new ( proxy ) ) ; } let ( connect_client , connection_receiver ) = create_request_stream ( ) ? ; let advertisement = proxy . advertise ( & mut services . into_iter ( ) . cloned ( ) , bredr :: ChannelParameters { channel_mode : Some ( channel_mode ) , .. bredr :: ChannelParameters :: EMPTY } , connect_client , ) . check ( ) ? ; Ok ( Self { proxy , advertisement : Some ( advertisement ) , connection_receiver : Some ( connection_receiver ) , searches : Vec :: new ( ) , terminated : false , } ) }
Create a new Profile that advertises the services in `services`.
Create a new Profile that advertises the services in ` services ` .
proxy
bredr::ProfileProxy
services
&[bredr::ServiceDefinition]
channel_mode
bredr::ChannelMode