pub trait AsyncRng {
    // Required method
    async fn get_random_number(&mut self) -> Result<u32, RadioError>;
}
Expand description

If the LoRa chip supports it, provides an async implementation of the onboard RNG. This trait makes no guarantees with regards to the distribution of the generated random numbers (ie, uniform or Gaussian). If uniformity is needed, apply necessary software processing.

Required Methods§

source

async fn get_random_number(&mut self) -> Result<u32, RadioError>

Generate a 32 bit random value.

Warning

prepare_for_xxx() MUST be called after this operation to set modulation and packet parameters (for example: xxx = tx, rx, cad). Do not set modulation and packet parameters, do a random number generation, then initiate Tx, Rx, or CAD.

Implementors§

source§

impl<RK, DLY> AsyncRng for LoRa<RK, DLY>where RK: RngRadio, DLY: DelayUs,