Struct esp32_nimble::BLEAdvertising

source ·
pub struct BLEAdvertising { /* private fields */ }

Implementations§

source§

impl BLEAdvertising

source

pub fn reset(&mut self) -> Result<(), BLEError>

source

pub fn set_data( &mut self, data: &mut BLEAdvertisementData, ) -> Result<(), BLEError>

source

pub fn set_raw_data(&mut self, data: &[u8]) -> Result<(), BLEError>

source

pub fn set_raw_scan_response_data( &mut self, data: &[u8], ) -> Result<(), BLEError>

source

pub fn advertisement_type(&mut self, adv_type: ConnMode) -> &mut Self

Set the type of advertisment to use.

source

pub fn disc_mode(&mut self, mode: DiscMode) -> &mut Self

Set discoverable mode.

source

pub fn high_duty_cycle(&mut self, val: bool) -> &mut Self

Set the duty cycle for advertisement_type.

Valid only if advertisement_type is directed-connectable.

source

pub fn min_interval(&mut self, interval: u16) -> &mut Self

Set the minimum advertising interval.

  • interval: advertising interval in 0.625ms units, 0 = use default.
source

pub fn max_interval(&mut self, interval: u16) -> &mut Self

Set the maximum advertising interval.

  • interval: advertising interval in 0.625ms units, 0 = use default.
source

pub fn scan_response(&mut self, value: bool) -> &mut Self

Set if scan response is available.

source

pub fn filter_policy(&mut self, value: AdvFilterPolicy) -> &mut Self

Set the filtering for the scan filter.

source

pub fn start(&mut self) -> Result<(), BLEError>

Start advertising. Advertising not stop until it is manually stopped.

source

pub fn start_with_duration(&mut self, duration_ms: i32) -> Result<(), BLEError>

Start advertising.

source

pub fn stop(&self) -> Result<(), BLEError>

source

pub fn is_advertising(&self) -> bool

source

pub fn on_complete( &mut self, callback: impl FnMut(c_int) + Send + Sync + 'static, ) -> &mut Self

Trait Implementations§

Auto Trait Implementations§

§

impl Freeze for BLEAdvertising

§

impl !RefUnwindSafe for BLEAdvertising

§

impl Sync for BLEAdvertising

§

impl Unpin for BLEAdvertising

§

impl !UnwindSafe for BLEAdvertising

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.