pub struct RadioConfig { /* private fields */ }Expand description
Frequency and bandwidth are whole hertz, transmit power is in dBm, coding rate is the 4/n denominator, and airtime locks remain pre-scaled as RNS’s wire int(percent * 100).
Implementations§
Source§impl RadioConfig
impl RadioConfig
Sourcepub fn new(input: RadioConfigInput) -> Result<RadioConfig, RadioConfigError>
pub fn new(input: RadioConfigInput) -> Result<RadioConfig, RadioConfigError>
Frequency arrives as u64 so it is validated before narrowing; transmit power arrives as i16 so a negative value is rejected rather than wrapped.
pub const fn frequency_hz(&self) -> u32
pub const fn bandwidth_hz(&self) -> u32
pub const fn tx_power_dbm(&self) -> u8
pub const fn spreading_factor(&self) -> u8
pub const fn coding_rate(&self) -> u8
pub const fn airtime_limit_short_centi_percent(&self) -> Option<u16>
pub const fn airtime_limit_long_centi_percent(&self) -> Option<u16>
pub const fn nominal_bitrate_bps(&self) -> u32
Sourcepub fn init_command_bytes(&self) -> Vec<u8> ⓘ
pub fn init_command_bytes(&self) -> Vec<u8> ⓘ
Emits the exact RNS initRadio order: frequency, bandwidth, transmit power, spreading factor, coding rate, optional airtime locks, then radio state on.
Trait Implementations§
Source§impl Clone for RadioConfig
impl Clone for RadioConfig
Source§fn clone(&self) -> RadioConfig
fn clone(&self) -> RadioConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for RadioConfig
Source§impl Debug for RadioConfig
impl Debug for RadioConfig
impl Eq for RadioConfig
Source§impl PartialEq for RadioConfig
impl PartialEq for RadioConfig
impl StructuralPartialEq for RadioConfig
Auto Trait Implementations§
impl Freeze for RadioConfig
impl RefUnwindSafe for RadioConfig
impl Send for RadioConfig
impl Sync for RadioConfig
impl Unpin for RadioConfig
impl UnsafeUnpin for RadioConfig
impl UnwindSafe for RadioConfig
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