Skip to main content

ble_hs_cfg

Struct ble_hs_cfg 

Source
#[repr(C)]
pub struct ble_hs_cfg {
Show 20 fields pub gatts_register_cb: Option<unsafe extern "C" fn(*mut ble_gatt_register_ctxt, *mut c_void)>, pub gatts_register_arg: *mut c_void, pub sm_io_cap: u8, pub _bitfield_align_1: [u8; 0], pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1]>, pub sm_sec_lvl: u8, pub _bitfield_align_2: [u8; 0], pub _bitfield_2: __BindgenBitfieldUnit<[u8; 1]>, pub eatt: u8, pub sm_our_key_dist: u8, pub sm_their_key_dist: u8, pub gatt_use_cache: u8, pub reset_cb: Option<unsafe extern "C" fn(i32)>, pub sync_cb: Option<unsafe extern "C" fn()>, pub store_gen_key_cb: Option<unsafe extern "C" fn(u8, *mut ble_store_gen_key, u16) -> i32>, pub store_read_cb: Option<unsafe extern "C" fn(i32, *const ble_store_key, *mut ble_store_value) -> i32>, pub store_write_cb: Option<unsafe extern "C" fn(i32, *const ble_store_value) -> i32>, pub store_delete_cb: Option<unsafe extern "C" fn(i32, *const ble_store_key) -> i32>, pub store_status_cb: Option<unsafe extern "C" fn(*mut ble_store_status_event, *mut c_void) -> i32>, pub store_status_arg: *mut c_void,
}
Expand description

@brief Bluetooth Host main configuration structure

Those can be used by application to configure stack.

The only reason Security Manager (sm_ members) is configurable at runtime is to simplify security testing. Defaults for those are configured by selecting proper options in application’s syscfg.

Fields§

§gatts_register_cb: Option<unsafe extern "C" fn(*mut ble_gatt_register_ctxt, *mut c_void)>

An optional callback that gets executed upon registration of each GATT resource (service, characteristic, or descriptor).

§gatts_register_arg: *mut c_void

An optional argument that gets passed to the GATT registration callback.

§sm_io_cap: u8

Security Manager Local Input Output Capabilities

§_bitfield_align_1: [u8; 0]§_bitfield_1: __BindgenBitfieldUnit<[u8; 1]>§sm_sec_lvl: u8

@brief Security Manager - Security Mode 1 Level for GATT related operations

Possible values are: 0: Default value, ignored 1: No security 2: Unauthenticated pairing with encryption 3. Authenticated pairing with encryption 4. Authenticated LE Secure Connections pairing with encryption using a 128-bit strength encryption key

§_bitfield_align_2: [u8; 0]§_bitfield_2: __BindgenBitfieldUnit<[u8; 1]>§eatt: u8

@brief Enable/Disable Enhanced ATT Support

Primarily used to enable EATT behaviour; denotes the number of eatt channels. Set to 0 to disable eatt.

Default value is CONFIG_BT_NIMBLE_EATT_CHAN_NUM.

§sm_our_key_dist: u8

@brief Security Manager Local Key Distribution Mask

§sm_their_key_dist: u8

@brief Security Manager Remote Key Distribution Mask

§gatt_use_cache: u8

@brief Weather to use GATT caching or not for discovery operations

§reset_cb: Option<unsafe extern "C" fn(i32)>

@brief Stack reset callback

This callback is executed when the host resets itself and the controller due to fatal error.

§sync_cb: Option<unsafe extern "C" fn()>

@brief Stack sync callback

This callback is executed when the host and controller become synced. This happens at startup and after a reset.

§store_gen_key_cb: Option<unsafe extern "C" fn(u8, *mut ble_store_gen_key, u16) -> i32>

Callback to handle generation of security keys

§store_read_cb: Option<unsafe extern "C" fn(i32, *const ble_store_key, *mut ble_store_value) -> i32>

Storage Read callback handles read of security material

§store_write_cb: Option<unsafe extern "C" fn(i32, *const ble_store_value) -> i32>

Storage Write callback handles write of security material

§store_delete_cb: Option<unsafe extern "C" fn(i32, *const ble_store_key) -> i32>

Storage Delete callback handles deletion of security material

§store_status_cb: Option<unsafe extern "C" fn(*mut ble_store_status_event, *mut c_void) -> i32>

@brief Storage Status callback.

This callback gets executed when a persistence operation cannot be performed or a persistence failure is imminent. For example, if is insufficient storage capacity for a record to be persisted, this function gets called to give the application the opportunity to make room.

§store_status_arg: *mut c_void

An optional argument that gets passed to the storage status callback.

Implementations§

Source§

impl ble_hs_cfg

Source

pub fn sm_oob_data_flag(&self) -> u32

Source

pub fn set_sm_oob_data_flag(&mut self, val: u32)

Source

pub unsafe fn sm_oob_data_flag_raw(this: *const ble_hs_cfg) -> u32

Source

pub unsafe fn set_sm_oob_data_flag_raw(this: *mut ble_hs_cfg, val: u32)

Source

pub fn sm_bonding(&self) -> u32

Source

pub fn set_sm_bonding(&mut self, val: u32)

Source

pub unsafe fn sm_bonding_raw(this: *const ble_hs_cfg) -> u32

Source

pub unsafe fn set_sm_bonding_raw(this: *mut ble_hs_cfg, val: u32)

Source

pub fn sm_mitm(&self) -> u32

Source

pub fn set_sm_mitm(&mut self, val: u32)

Source

pub unsafe fn sm_mitm_raw(this: *const ble_hs_cfg) -> u32

Source

pub unsafe fn set_sm_mitm_raw(this: *mut ble_hs_cfg, val: u32)

Source

pub fn sm_sc(&self) -> u32

Source

pub fn set_sm_sc(&mut self, val: u32)

Source

pub unsafe fn sm_sc_raw(this: *const ble_hs_cfg) -> u32

Source

pub unsafe fn set_sm_sc_raw(this: *mut ble_hs_cfg, val: u32)

Source

pub fn sm_sc_only(&self) -> u32

Source

pub fn set_sm_sc_only(&mut self, val: u32)

Source

pub unsafe fn sm_sc_only_raw(this: *const ble_hs_cfg) -> u32

Source

pub unsafe fn set_sm_sc_only_raw(this: *mut ble_hs_cfg, val: u32)

Source

pub fn new_bitfield_1( sm_oob_data_flag: u32, sm_bonding: u32, sm_mitm: u32, sm_sc: u32, sm_sc_only: u32, ) -> __BindgenBitfieldUnit<[u8; 1]>

Source

pub fn sm_keypress(&self) -> u32

Source

pub fn set_sm_keypress(&mut self, val: u32)

Source

pub unsafe fn sm_keypress_raw(this: *const ble_hs_cfg) -> u32

Source

pub unsafe fn set_sm_keypress_raw(this: *mut ble_hs_cfg, val: u32)

Source

pub fn new_bitfield_2(sm_keypress: u32) -> __BindgenBitfieldUnit<[u8; 1]>

Trait Implementations§

Source§

impl Clone for ble_hs_cfg

Source§

fn clone(&self) -> ble_hs_cfg

Returns a duplicate of the value. Read more
1.0.0 (const: unstable)§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for ble_hs_cfg

Source§

impl Debug for ble_hs_cfg

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Default for ble_hs_cfg

Source§

fn default() -> ble_hs_cfg

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl !Send for ble_hs_cfg

§

impl !Sync for ble_hs_cfg

§

impl Freeze for ble_hs_cfg

§

impl RefUnwindSafe for ble_hs_cfg

§

impl Unpin for ble_hs_cfg

§

impl UnsafeUnpin for ble_hs_cfg

§

impl UnwindSafe for ble_hs_cfg

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> CloneToUninit for T
where T: Clone,

§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
§

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

§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.