[−][src]Struct bluetooth_hci::host::ConnectionIntervalBuilder
Intermediate builder for the ConnectionInterval
.
Implementations
impl ConnectionIntervalBuilder
[src]
pub fn new() -> ConnectionIntervalBuilder
[src]
Initializes a new builder.
pub fn with_range(
&mut self,
min: Duration,
max: Duration
) -> &mut ConnectionIntervalBuilder
[src]
&mut self,
min: Duration,
max: Duration
) -> &mut ConnectionIntervalBuilder
Sets the connection interval range.
Errors
There are no errors from this function, but it may cause errors in build if:
min
is greater thanmax
- Either
min
ormax
is less than 7.5 ms or more than 4 seconds. max
leads to an invalid relative supervision timeout.
pub fn with_latency(&mut self, latency: u16) -> &mut ConnectionIntervalBuilder
[src]
Sets the connection latency.
Errors
There are no errors from this function, but it may cause errors in build if:
latency
is 500 or greater.latency
leads to an invalid relative supervision timeout.
pub fn with_supervision_timeout(
&mut self,
timeout: Duration
) -> &mut ConnectionIntervalBuilder
[src]
&mut self,
timeout: Duration
) -> &mut ConnectionIntervalBuilder
Sets the supervision timeout.
Errors
There are no errors from this function, but it may cause errors in build if:
timeout
less than 100 ms or greater than 32 secondstimeout
results in an invalid relative supervision timeout.
pub fn build(&self) -> Result<ConnectionInterval, ConnectionIntervalError>
[src]
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
impl Default for ConnectionIntervalBuilder
[src]
Auto Trait Implementations
impl Send for ConnectionIntervalBuilder
impl Sync for ConnectionIntervalBuilder
impl Unpin for ConnectionIntervalBuilder
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,