pub struct ConnectionInterval { /* private fields */ }
Expand description
Define a connection interval range with its latency and supervision timeout. This value is passed to the controller, which determines the actual connection interval.
Implementations§
Source§impl ConnectionInterval
impl ConnectionInterval
Sourcepub fn conn_latency(&self) -> u16
pub fn conn_latency(&self) -> u16
Returns the connection latency, in number of events.
Sourcepub fn supervision_timeout(&self) -> Duration
pub fn supervision_timeout(&self) -> Duration
Returns the supervision timeout.
Sourcepub fn copy_into_slice(&self, bytes: &mut [u8])
pub fn copy_into_slice(&self, bytes: &mut [u8])
Serializes the connection interval into the given byte buffer.
The interval is serialized as:
- The minimum interval value, appropriately converted (2 bytes)
- The maximum interval value, appropriately converted (2 bytes)
- The connection latency (2 bytes)
- The supervision timeout, appropriately converted (2 bytes)
§Panics
The provided buffer must be at least 8 bytes long.
Sourcepub fn from_bytes(bytes: &[u8]) -> Result<Self, ConnectionIntervalError>
pub fn from_bytes(bytes: &[u8]) -> Result<Self, ConnectionIntervalError>
Deserializes the connection interval from the given byte buffer.
- The minimum interval value, appropriately converted (2 bytes)
- The maximum interval value, appropriately converted (2 bytes)
- The connection latency (2 bytes)
- The supervision timeout, appropriately converted (2 bytes)
§Panics
The provided buffer must be at least 8 bytes long.
§Errors
Any of the errors from the builder except for Incomplete.
Trait Implementations§
Source§impl Clone for ConnectionInterval
impl Clone for ConnectionInterval
Source§fn clone(&self) -> ConnectionInterval
fn clone(&self) -> ConnectionInterval
Returns a copy 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 ConnectionInterval
impl Debug for ConnectionInterval
impl Copy for ConnectionInterval
Auto Trait Implementations§
impl Freeze for ConnectionInterval
impl RefUnwindSafe for ConnectionInterval
impl Send for ConnectionInterval
impl Sync for ConnectionInterval
impl Unpin for ConnectionInterval
impl UnwindSafe for ConnectionInterval
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