Skip to main content

Capabilities

Struct Capabilities 

Source
pub struct Capabilities {
Show 17 fields pub public_address: [u8; 6], pub hci_version: u8, pub hci_subversion: u16, pub lmp_version: u8, pub lmp_subversion: u16, pub manufacturer: u16, pub commands: [u8; 64], pub lmp_features: u64, pub le_features: u64, pub le_states: u64, pub le_acl: (u16, u16), pub iso: (u16, u8), pub max_adv_data: u16, pub adv_sets: u8, pub filter_accept_list_size: u8, pub resolving_list_size: u8, pub max_data_length: (u16, u16, u16, u16),
}
Expand description

The controller’s identity and capabilities.

Fields§

§public_address: [u8; 6]

The public address, least significant byte first; all zeros when the controller has none.

§hci_version: u8

HCI version (a Core Specification version number).

§hci_subversion: u16

HCI subversion.

§lmp_version: u8

LMP/LL version.

§lmp_subversion: u16

LMP/LL subversion.

§manufacturer: u16

Manufacturer (a company identifier).

§commands: [u8; 64]

Supported commands, the 64-octet mask.

§lmp_features: u64

LMP features, page 0.

§le_features: u64

LE features.

§le_states: u64

LE supported states.

§le_acl: (u16, u16)

Maximum LE ACL data length per packet, and how many the controller buffers.

§iso: (u16, u8)

Maximum ISO data length and buffer count (0 when ISO is not supported).

§max_adv_data: u16

Maximum extended advertising data length (31 for legacy only).

§adv_sets: u8

Number of advertising sets (1 for legacy only).

§filter_accept_list_size: u8

Filter Accept List size.

§resolving_list_size: u8

Resolving List size (0 without LL privacy).

§max_data_length: (u16, u16, u16, u16)

Maximum data length: (tx octets, tx time, rx octets, rx time).

Implementations§

Source§

impl Capabilities

Source

pub fn cmds(&self) -> CmdMask

The supported-commands mask, with a getter per command.

Source

pub fn le(&self, bit: u32) -> bool

Whether an LE feature bit is set.

Source

pub fn extended_advertising(&self) -> bool

Extended advertising, scanning and connecting (Bluetooth 5). The feature bit makes those commands mandatory (Core Vol 4, Part E, 3), so it alone decides: some controllers leave them out of their supported-commands mask.

Source

pub fn extended_scanning(&self) -> bool

Extended scanning commands (the same feature bit).

Source

pub fn periodic_advertising(&self) -> bool

Periodic advertising.

Source

pub fn coded_phy(&self) -> bool

The coded PHY (long range).

Source

pub fn phy_2m(&self) -> bool

The 2M PHY.

Source

pub fn data_length_extension(&self) -> bool

Data length extension.

Source

pub fn phy_update(&self) -> bool

Changing PHY on a connection.

Source

pub fn le_feature_names(&self) -> Vec<&'static str>

Names of the LE features the controller has.

Source

pub fn manufacturer_name(&self) -> Option<&'static str>

The manufacturer’s name, from the assigned numbers.

Source

pub fn version_name(&self) -> Option<&'static str>

The Core Specification version the controller implements.

Trait Implementations§

Source§

impl Clone for Capabilities

Source§

fn clone(&self) -> Self

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

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Capabilities

Source§

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

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

impl Serialize for Capabilities

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

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
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

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

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

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

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

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

Source§

type Error = !

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

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

Performs the conversion.
Source§

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

Source§

type Error = <U as TryFrom<T>>::Error

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

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more