pub enum BlePhy {
Le1M,
Le2M,
LeCodedS2,
LeCodedS8,
}Expand description
BLE Physical Layer (PHY) options
BLE 5.0 introduced multiple PHY options for different use cases:
- LE 1M: Standard 1 Mbps rate, good range
- LE 2M: High speed 2 Mbps, reduced range
- LE Coded: Long range mode with error correction
Variants§
Le1M
LE 1M PHY - 1 Mbps, ~100m range
The standard BLE PHY, compatible with all BLE devices. Good balance of speed and range.
Le2M
LE 2M PHY - 2 Mbps, ~50m range
Double the data rate but reduced range. Use for high-throughput short-range links.
LeCodedS2
LE Coded S=2 PHY - 500 kbps, ~200m range
Coded PHY with 2x redundancy. Good balance of range and throughput.
LeCodedS8
LE Coded S=8 PHY - 125 kbps, ~400m range
Coded PHY with 8x redundancy. Maximum range but lowest throughput.
Implementations§
Source§impl BlePhy
impl BlePhy
Sourcepub fn data_rate_bps(&self) -> u32
pub fn data_rate_bps(&self) -> u32
Get the data rate in bits per second
Sourcepub fn data_rate_kbps(&self) -> u32
pub fn data_rate_kbps(&self) -> u32
Get the data rate in kilobits per second
Sourcepub fn typical_range_m(&self) -> u16
pub fn typical_range_m(&self) -> u16
Get typical maximum range in meters (line of sight)
Sourcepub fn typical_latency_ms(&self) -> u16
pub fn typical_latency_ms(&self) -> u16
Get typical latency in milliseconds for a connection event
Sourcepub fn requires_ble5(&self) -> bool
pub fn requires_ble5(&self) -> bool
Check if this requires BLE 5.0
Sourcepub fn coding_scheme(&self) -> Option<u8>
pub fn coding_scheme(&self) -> Option<u8>
Get the coding scheme (S value) for coded PHYs
Sourcepub fn transmit_time_us(&self, bytes: usize) -> u64
pub fn transmit_time_us(&self, bytes: usize) -> u64
Calculate approximate time to transmit data
Sourcepub fn relative_power(&self) -> f32
pub fn relative_power(&self) -> f32
Estimate power consumption relative to LE 1M (1.0 = baseline)
Trait Implementations§
impl Copy for BlePhy
impl Eq for BlePhy
impl StructuralPartialEq for BlePhy
Auto Trait Implementations§
impl Freeze for BlePhy
impl RefUnwindSafe for BlePhy
impl Send for BlePhy
impl Sync for BlePhy
impl Unpin for BlePhy
impl UnwindSafe for BlePhy
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.