Struct esp32_nimble::BLESecurity

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

Implementations§

source§

impl BLESecurity

source

pub fn set_auth(&mut self, auth_req: AuthReq) -> &mut Self

Set the authorization mode for this device.

source

pub fn get_passkey(&self) -> u32

Get the current passkey used for pairing.

source

pub fn set_passkey(&mut self, passkey: u32) -> &mut Self

Set the passkey the server will ask for when pairing.

  • The passkey will always be exactly 6 digits. Setting the passkey to 1234 will require the user to provide ‘001234’
  • a dynamic passkey can also be set by crate::BLEServer::on_passkey_request
source

pub fn set_io_cap(&mut self, iocap: SecurityIOCap) -> &mut Self

Set the Input/Output capabilities of this device.

source

pub fn set_security_init_key(&mut self, init_key: PairKeyDist) -> &mut Self

If we are the initiator of the security procedure this sets the keys we will distribute.

source

pub fn set_security_resp_key(&mut self, resp_key: PairKeyDist) -> &mut Self

Set the keys we are willing to accept during pairing.

source

pub fn resolve_rpa(&mut self) -> &mut Self

Set up for pairing in RPA(Resolvable Private Address).

( see: https://github.com/taks/esp32-nimble/issues/24 )

Auto Trait Implementations§

§

impl Freeze for BLESecurity

§

impl RefUnwindSafe for BLESecurity

§

impl Send for BLESecurity

§

impl Sync for BLESecurity

§

impl Unpin for BLESecurity

§

impl UnwindSafe for BLESecurity

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.