[−][src]Struct esb::ConfigBuilder
A builder for an Config
structure
The builder is converted into an Config
by calling the
check()
method.
Example
use esb::ConfigBuilder; let config_result = ConfigBuilder::default() .wait_for_ack_timeout(50) .retransmit_delay(240) .maximum_transmit_attempts(4) .enabled_pipes(0x01) .check(); assert!(config_result.is_ok());
Default Config Contents
By default, the following settings will be used:
Field | Default Value |
---|---|
Ack Timeout | 120 us |
Retransmit Delay | 500 us |
Maximum number of transmit attempts | 3 |
Enabled Pipes | 0xFF |
Tx Power | 0dBm |
Maximum payload size | 252 bytes |
Implementations
impl ConfigBuilder
[src]
pub fn wait_for_ack_timeout(self, micros: u16) -> Self
[src]
Sets number of microseconds to wait for an acknowledgement before timing out
pub fn retransmit_delay(self, micros: u16) -> Self
[src]
Sets retransmit delay, must be bigger than wait_for_ack_timeout
field plus 62 and bigger
than the ramp-up time (140us without fast-ru and 40us with fast-ru)
pub fn maximum_transmit_attempts(self, n: u8) -> Self
[src]
Sets maximum number of transmit attempts
pub fn enabled_pipes(self, enabled_pipes: u8) -> Self
[src]
Sets enabled pipes for receiving
pub fn tx_power(self, tx_power: TxPower) -> Self
[src]
Sets the tx power
pub fn max_payload_size(self, payload_size: u8) -> Self
[src]
Sets the maximum payload size
pub fn check(self) -> Result<Config, Error>
[src]
Trait Implementations
impl Default for ConfigBuilder
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,