Struct bluenrg::event::ConnectionInterval [−][src]
pub struct ConnectionInterval { /* fields omitted */ }
Define a connection interval range with its latency and supervision timeout. This value is passed to the controller, which determines the actual connection interval.
Methods
impl ConnectionInterval
[src]
impl ConnectionInterval
pub fn interval(&self) -> (Duration, Duration)
[src]
pub fn interval(&self) -> (Duration, Duration)
Returns the connection interval.
pub fn conn_latency(&self) -> u16
[src]
pub fn conn_latency(&self) -> u16
Returns the connection latency, in number of events.
pub fn supervision_timeout(&self) -> Duration
[src]
pub fn supervision_timeout(&self) -> Duration
Returns the supervision timeout.
pub fn into_bytes(&self, bytes: &mut [u8])
[src]
pub fn into_bytes(&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.
pub fn from_bytes(
bytes: &[u8]
) -> Result<ConnectionInterval, ConnectionIntervalError>
[src]
pub fn from_bytes(
bytes: &[u8]
) -> Result<ConnectionInterval, 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
impl Debug for ConnectionInterval
[src]
impl Debug for ConnectionInterval
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
[src]
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
Formats the value using the given formatter. Read more
impl Clone for ConnectionInterval
[src]
impl Clone for ConnectionInterval
fn clone(&self) -> ConnectionInterval
[src]
fn clone(&self) -> ConnectionInterval
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl Copy for ConnectionInterval
[src]
impl Copy for ConnectionInterval
Auto Trait Implementations
impl Send for ConnectionInterval
impl Send for ConnectionInterval
impl Sync for ConnectionInterval
impl Sync for ConnectionInterval