pub struct AdapterInfo {
pub id: String,
pub name: Option<String>,
pub address: Option<String>,
pub powered: bool,
pub is_default: bool,
}Expand description
One Bluetooth controller.
Obtained from Bluetooth::adapters. The id is what
Bluetooth::select_adapter takes, and is whatever the platform
uses to name a radio: hci0 on Linux, a device interface path on Windows.
Fields§
§id: StringWhat Bluetooth::select_adapter takes to choose this controller.
name: Option<String>A human-readable name, where the platform has one.
address: Option<String>The controller’s own Bluetooth address, where the platform exposes it.
powered: boolWhether the radio is on.
is_default: boolWhether this is the controller a plain Bluetooth::new uses.
Implementations§
Source§impl AdapterInfo
impl AdapterInfo
Sourcepub fn name(&self) -> Option<&str>
pub fn name(&self) -> Option<&str>
A human-readable name, where the platform has one.
BlueZ reports the adapter’s Alias, which is what the machine
advertises as. None where the platform does not name its radios.
Sourcepub fn address(&self) -> Option<&str>
pub fn address(&self) -> Option<&str>
The controller’s own Bluetooth address.
None where the platform withholds it: CoreBluetooth never exposes it,
and Android returns a fixed placeholder to ordinary apps rather than
the real address, which is reported as None rather than as that
placeholder.
Sourcepub fn is_powered(&self) -> bool
pub fn is_powered(&self) -> bool
Whether the radio is switched on.
Sourcepub fn is_default(&self) -> bool
pub fn is_default(&self) -> bool
Whether this is the controller a plain Bluetooth::new uses.