pub struct BleConfig {
pub adapter: Option<String>,
pub psm: Option<u16>,
pub mtu: Option<u16>,
pub max_connections: Option<usize>,
pub connect_timeout_ms: Option<u64>,
pub advertise: Option<bool>,
pub scan: Option<bool>,
pub auto_connect: Option<bool>,
pub accept_connections: Option<bool>,
pub probe_cooldown_secs: Option<u64>,
}Expand description
BLE transport instance configuration.
BleConfig is always compiled (for config parsing on any platform),
but the transport runtime requires Linux and the ble feature.
Fields§
§adapter: Option<String>HCI adapter name (e.g., “hci0”). Required.
psm: Option<u16>L2CAP PSM for FIPS connections. Default: 0x0085 (133).
mtu: Option<u16>Default MTU for BLE connections. Default: 2048.
max_connections: Option<usize>Maximum concurrent BLE connections. Default: 7.
connect_timeout_ms: Option<u64>Outbound connect timeout in milliseconds. Default: 10000.
advertise: Option<bool>Broadcast BLE advertisements. Default: true.
scan: Option<bool>Listen for BLE advertisements. Default: true.
auto_connect: Option<bool>Auto-connect to discovered BLE peers. Default: false.
accept_connections: Option<bool>Accept incoming BLE connections. Default: true.
probe_cooldown_secs: Option<u64>Probe cooldown in seconds. After probing a BLE address, wait this long before probing the same address again. Default: 30.
Implementations§
Source§impl BleConfig
impl BleConfig
Sourcepub fn max_connections(&self) -> usize
pub fn max_connections(&self) -> usize
Get the maximum concurrent connections. Default: 7.
Sourcepub fn connect_timeout_ms(&self) -> u64
pub fn connect_timeout_ms(&self) -> u64
Get the connect timeout in milliseconds. Default: 10000.
Sourcepub fn auto_connect(&self) -> bool
pub fn auto_connect(&self) -> bool
Whether to auto-connect to discovered peers. Default: false.
Sourcepub fn accept_connections(&self) -> bool
pub fn accept_connections(&self) -> bool
Whether to accept incoming connections. Default: true.
Sourcepub fn probe_cooldown_secs(&self) -> u64
pub fn probe_cooldown_secs(&self) -> u64
Get the probe cooldown in seconds. Default: 30.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for BleConfig
impl<'de> Deserialize<'de> for BleConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for BleConfig
impl RefUnwindSafe for BleConfig
impl Send for BleConfig
impl Sync for BleConfig
impl Unpin for BleConfig
impl UnsafeUnpin for BleConfig
impl UnwindSafe for BleConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more