Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Accept BLESecurity when taking the BLEDevice #52

Open
LarryMerino opened this issue Nov 22, 2023 · 0 comments
Open

Accept BLESecurity when taking the BLEDevice #52

LarryMerino opened this issue Nov 22, 2023 · 0 comments

Comments

@LarryMerino
Copy link

I was thinking of creating different security profiles based on some feature (for example) but the BLEDevice does not accept BLESecurity when taking it.

It is possible to do something like this?:

...
#[cfg(feature = "low_security")]
let ble_security = BLESecurity::builder()
            .security()
            .set_auth(true, true, true)
            .set_passkey(123456)
            .set_io_cap(SecurityIOCap::DisplayOnly);

#[cfg(feature = "high_security")]
let ble_security = BLESecurity::builder()
            .security()
            .set_auth(true, true, true)
            .set_passkey(952384)
            .set_io_cap(SecurityIOCap::DisplayOnly);

let ble_device = BLEDevice::take_with_security_conf(ble_security);
...
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant