Functions that provide access to random numbers. More...

Functions

void halStackSeedRandom (uint32_t seed)
 Seeds the halCommonGetRandom() pseudorandom number generator. More...
 
uint16_t halCommonGetRandom (void)
 Runs a standard LFSR to generate pseudorandom numbers. More...
 

Detailed Description

Functions that provide access to random numbers.

These functions may be hardware accelerated, though often are not.

See random.h for source code.

Function Documentation

uint16_t halCommonGetRandom ( void  )

Runs a standard LFSR to generate pseudorandom numbers.

Called by the MAC in the stack to choose random backoff slots.

Complicated implementations may improve the MAC's ability to avoid collisions in large networks, but it is critical to implement this function to return quickly.

void halStackSeedRandom ( uint32_t  seed)

Seeds the halCommonGetRandom() pseudorandom number generator.

Called by the stack during initialization with a seed from the radio.

Parameters
seedA seed for the pseudorandom number generator.