Struct bluetooth_hci::host::ConnectionIntervalBuilder [−][src]
pub struct ConnectionIntervalBuilder { /* fields omitted */ }
Intermediate builder for the ConnectionInterval
Methods
impl ConnectionIntervalBuilder
[src]
impl ConnectionIntervalBuilder
pub fn new() -> ConnectionIntervalBuilder
[src]
pub fn new() -> ConnectionIntervalBuilder
Initializes a new builder.
pub fn with_range(
&mut self,
min: Duration,
max: Duration
) -> &mut ConnectionIntervalBuilder
[src]
pub fn with_range(
&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]
pub fn with_latency(&mut self, latency: u16) -> &mut ConnectionIntervalBuilder
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]
pub fn with_supervision_timeout(
&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]
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.
Auto Trait Implementations
impl Send for ConnectionIntervalBuilder
impl Send for ConnectionIntervalBuilder
impl Sync for ConnectionIntervalBuilder
impl Sync for ConnectionIntervalBuilder