Struct esp32_nimble::BLEDevice
source · pub struct BLEDevice { /* private fields */ }
Implementations§
source§impl BLEDevice
impl BLEDevice
pub fn init()
pub fn take() -> &'static mut Self
sourcepub fn deinit_full() -> Result<(), EspError>
pub fn deinit_full() -> Result<(), EspError>
Shutdown the NimBLE stack/controller server/advertising/scan will be reset.
pub fn get_scan(&self) -> &'static mut BLEScan
pub fn get_server(&self) -> &'static mut BLEServer
pub fn get_advertising(&self) -> &'static Mutex<BLEAdvertising>
pub fn set_power( &mut self, power_type: PowerType, power_level: PowerLevel ) -> Result<(), BLEError>
pub fn get_power(&self, power_type: PowerType) -> PowerLevel
sourcepub fn bonded_addresses(&self) -> Result<Vec<BLEAddress>, BLEError>
pub fn bonded_addresses(&self) -> Result<Vec<BLEAddress>, BLEError>
Get the addresses of all bonded peer device.
sourcepub fn delete_all_bonds(&self) -> Result<(), BLEError>
pub fn delete_all_bonds(&self) -> Result<(), BLEError>
Deletes all bonding information.
sourcepub fn delete_bond(&self, address: &BLEAddress) -> Result<(), BLEError>
pub fn delete_bond(&self, address: &BLEAddress) -> Result<(), BLEError>
Deletes a peer bond.
address
: The address of the peer with which to delete bond info.
pub fn set_white_list( &mut self, white_list: &[BLEAddress] ) -> Result<(), BLEError>
pub fn security(&mut self) -> &mut BLESecurity
sourcepub fn set_own_addr_type(&mut self, own_addr_type: OwnAddrType)
pub fn set_own_addr_type(&mut self, own_addr_type: OwnAddrType)
Set the own address type.
sourcepub fn set_own_addr_type_to_non_resolvable_random(&mut self)
pub fn set_own_addr_type_to_non_resolvable_random(&mut self)
Set the own address type to non-resolvable random address.
sourcepub fn set_rnd_addr(&mut self, addr: [u8; 6]) -> Result<(), BLEError>
pub fn set_rnd_addr(&mut self, addr: [u8; 6]) -> Result<(), BLEError>
Set the own address to be used when the address type is random.