Struct stm32wb_hci::types::ConnectionIntervalBuilder
source · pub struct ConnectionIntervalBuilder { /* private fields */ }
Expand description
Intermediate builder for the ConnectionInterval
.
Implementations§
source§impl ConnectionIntervalBuilder
impl ConnectionIntervalBuilder
sourcepub fn new() -> ConnectionIntervalBuilder
pub fn new() -> ConnectionIntervalBuilder
Initializes a new builder.
sourcepub fn with_range(
&mut self,
min: Duration,
max: Duration
) -> &mut ConnectionIntervalBuilder
pub fn with_range( &mut self, min: Duration, max: Duration ) -> &mut ConnectionIntervalBuilder
sourcepub fn with_latency(&mut self, latency: u16) -> &mut ConnectionIntervalBuilder
pub fn with_latency(&mut self, latency: u16) -> &mut ConnectionIntervalBuilder
sourcepub fn with_supervision_timeout(
&mut self,
timeout: Duration
) -> &mut ConnectionIntervalBuilder
pub fn with_supervision_timeout( &mut self, timeout: Duration ) -> &mut ConnectionIntervalBuilder
sourcepub fn build(&self) -> Result<ConnectionInterval, ConnectionIntervalError>
pub fn build(&self) -> Result<ConnectionInterval, ConnectionIntervalError>
Builds the connection interval if all parameters are valid.
Errors
- Incomplete if any of
with_range
,with_latency
, orwith_supervision_timeout
have not been called. - IntervalTooShort if the minimum range value is less than 7.5 ms.
- IntervalTooLong if the maximum range value is greater than 4 seconds.
- IntervalInverted if the minimum range value is greater than the maximum.
- BadConnectionLatency if the connection latency is 500 or more.
- SupervisionTimeoutTooShort if the supervision timeout is less than 100 ms, or if it is less than the computed minimum: (1 + latency) * interval max * 2.
- SupervisionTimeoutTooLong if the supervision timeout is more than 32 seconds.
- ImpossibleSupervisionTimeout if the computed minimum supervision timeout ((1 + latency) * interval max * 2) is 32 seconds or more.
Trait Implementations§
source§impl Default for ConnectionIntervalBuilder
impl Default for ConnectionIntervalBuilder
source§fn default() -> ConnectionIntervalBuilder
fn default() -> ConnectionIntervalBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl RefUnwindSafe for ConnectionIntervalBuilder
impl Send for ConnectionIntervalBuilder
impl Sync for ConnectionIntervalBuilder
impl Unpin for ConnectionIntervalBuilder
impl UnwindSafe for ConnectionIntervalBuilder
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