[][src]Struct esb::ConfigBuilder

pub struct 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:

FieldDefault Value
Ack Timeout120 us
Retransmit Delay500 us
Maximum number of transmit attempts3
Enabled Pipes0xFF
Tx Power0dBm
Maximum payload size252 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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

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]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.