pub struct PlatformConfig {
pub platform: Platform,
pub recommended_scan_duration: Duration,
pub minimum_scan_duration: Duration,
pub recommended_connection_timeout: Duration,
pub recommended_operation_timeout: Duration,
pub operation_delay: Duration,
pub exposes_mac_address: bool,
pub recommended_scan_retries: u32,
pub scan_retry_delay: Duration,
pub max_concurrent_connections: usize,
}Expand description
Platform-specific BLE configuration.
Fields§
§platform: PlatformThe platform this configuration is for.
recommended_scan_duration: DurationRecommended scan duration for device discovery.
- macOS: Longer (8s) because advertisements can be 4+ seconds apart
- Linux: Medium (5s) with BlueZ
- Windows: Medium (5s)
minimum_scan_duration: DurationMinimum scan duration for quick scans.
recommended_connection_timeout: DurationRecommended connection timeout.
- macOS: Shorter (10s) as CoreBluetooth is generally faster
- Linux: Longer (15s) as BlueZ may have overhead
- Windows: Medium (12s)
recommended_operation_timeout: DurationRecommended read/write operation timeout.
operation_delay: DurationDelay between consecutive BLE operations to avoid overwhelming the stack.
exposes_mac_address: boolWhether the platform exposes MAC addresses (false on macOS).
recommended_scan_retries: u32Recommended number of scan retries.
scan_retry_delay: DurationRecommended delay between scan retries.
max_concurrent_connections: usizeMaximum recommended concurrent connections.
Most BLE adapters support 5-7 concurrent connections.
Implementations§
Source§impl PlatformConfig
impl PlatformConfig
Sourcepub fn for_current_platform() -> Self
pub fn for_current_platform() -> Self
Get the configuration for the current platform.
Sourcepub fn for_platform(platform: Platform) -> Self
pub fn for_platform(platform: Platform) -> Self
Get the configuration for a specific platform.
Trait Implementations§
Source§impl Clone for PlatformConfig
impl Clone for PlatformConfig
Source§fn clone(&self) -> PlatformConfig
fn clone(&self) -> PlatformConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PlatformConfig
impl Debug for PlatformConfig
Source§impl Default for PlatformConfig
impl Default for PlatformConfig
Source§impl From<&PlatformConfig> for PlatformConfigSnapshot
impl From<&PlatformConfig> for PlatformConfigSnapshot
Source§fn from(config: &PlatformConfig) -> Self
fn from(config: &PlatformConfig) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for PlatformConfig
impl RefUnwindSafe for PlatformConfig
impl Send for PlatformConfig
impl Sync for PlatformConfig
impl Unpin for PlatformConfig
impl UnwindSafe for PlatformConfig
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
Mutably borrows from an owned value. Read more