pub struct BLEAdvertising { /* private fields */ }Implementations§
Source§impl BLEAdvertising
impl BLEAdvertising
pub fn reset(&mut self) -> Result<(), BLEError>
pub fn set_data( &mut self, data: &mut BLEAdvertisementData, ) -> Result<(), BLEError>
pub fn set_raw_data(&mut self, data: &[u8]) -> Result<(), BLEError>
pub fn set_raw_scan_response_data( &mut self, data: &[u8], ) -> Result<(), BLEError>
Sourcepub fn advertisement_type(&mut self, adv_type: ConnMode) -> &mut Self
pub fn advertisement_type(&mut self, adv_type: ConnMode) -> &mut Self
Set the type of advertisment to use.
Sourcepub fn high_duty_cycle(&mut self, val: bool) -> &mut Self
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.
Sourcepub fn min_interval(&mut self, interval: u16) -> &mut Self
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.
Sourcepub fn max_interval(&mut self, interval: u16) -> &mut Self
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.
Sourcepub fn scan_response(&mut self, value: bool) -> &mut Self
pub fn scan_response(&mut self, value: bool) -> &mut Self
Set if scan response is available.
Sourcepub fn filter_policy(&mut self, value: AdvFilterPolicy) -> &mut Self
pub fn filter_policy(&mut self, value: AdvFilterPolicy) -> &mut Self
Set the filtering for the scan filter.
Sourcepub fn start(&mut self) -> Result<(), BLEError>
pub fn start(&mut self) -> Result<(), BLEError>
Start advertising. Advertising not stop until it is manually stopped.
Sourcepub fn start_with_duration(&mut self, duration_ms: i32) -> Result<(), BLEError>
pub fn start_with_duration(&mut self, duration_ms: i32) -> Result<(), BLEError>
Start advertising.
pub fn stop(&self) -> Result<(), BLEError>
pub fn is_advertising(&self) -> bool
pub fn on_complete( &mut self, callback: impl FnMut(c_int) + Send + Sync + 'static, ) -> &mut Self
Trait Implementations§
impl Send for BLEAdvertising
Auto Trait Implementations§
impl Freeze for BLEAdvertising
impl !RefUnwindSafe for BLEAdvertising
impl Sync for BLEAdvertising
impl Unpin for BLEAdvertising
impl UnsafeUnpin for BLEAdvertising
impl !UnwindSafe for BLEAdvertising
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more