pub struct ManagerConfig {
pub scan_options: ScanOptions,
pub default_reconnect_options: ReconnectOptions,
pub event_capacity: usize,
pub health_check_interval: Duration,
pub max_concurrent_connections: usize,
pub use_adaptive_interval: bool,
pub min_health_check_interval: Duration,
pub max_health_check_interval: Duration,
pub default_priority: DevicePriority,
pub use_connection_validation: bool,
}Expand description
Configuration for the device manager.
Fields§
§scan_options: ScanOptionsDefault scan options.
default_reconnect_options: ReconnectOptionsDefault reconnect options for new devices.
event_capacity: usizeEvent channel capacity.
health_check_interval: DurationHealth check interval for auto-reconnect (base interval).
max_concurrent_connections: usizeMaximum number of concurrent BLE connections.
Most BLE adapters support 5-7 concurrent connections. Attempting to connect beyond this limit will return an error. Set to 0 for no limit (not recommended).
use_adaptive_interval: boolWhether to use adaptive health check intervals.
When enabled, the health check interval will automatically adjust:
- Decrease (more frequent) when connections are unstable
- Increase (less frequent) when connections are stable
min_health_check_interval: DurationMinimum health check interval (for adaptive mode).
max_health_check_interval: DurationMaximum health check interval (for adaptive mode).
default_priority: DevicePriorityDefault priority for new devices.
use_connection_validation: boolWhether to use connection validation (keepalive checks).
When enabled, health checks will use device.validate_connection()
which performs an actual BLE read to verify the connection is alive.
This catches “zombie connections” but uses more power.
Implementations§
Source§impl ManagerConfig
impl ManagerConfig
Sourcepub fn with_max_connections(self, max: usize) -> Self
pub fn with_max_connections(self, max: usize) -> Self
Create a configuration with a specific connection limit.
Sourcepub fn unlimited_connections(self) -> Self
pub fn unlimited_connections(self) -> Self
Create a configuration with no connection limit (not recommended).
Sourcepub fn adaptive_interval(self, enabled: bool) -> Self
pub fn adaptive_interval(self, enabled: bool) -> Self
Enable or disable adaptive health check intervals.
Sourcepub fn health_check_interval(self, interval: Duration) -> Self
pub fn health_check_interval(self, interval: Duration) -> Self
Set the health check interval (base interval for adaptive mode).
Sourcepub fn default_priority(self, priority: DevicePriority) -> Self
pub fn default_priority(self, priority: DevicePriority) -> Self
Set the default device priority.
Sourcepub fn connection_validation(self, enabled: bool) -> Self
pub fn connection_validation(self, enabled: bool) -> Self
Enable or disable connection validation in health checks.
Trait Implementations§
Source§impl Clone for ManagerConfig
impl Clone for ManagerConfig
Source§fn clone(&self) -> ManagerConfig
fn clone(&self) -> ManagerConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more