Random Numbers#

Functions that provide access to random numbers.

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

See random.h for source code.

Functions#

void
halStackSeedRandom(uint32_t seed)

Seeds the halCommonGetRandom() pseudorandom number generator.

uint16_t

Runs a standard LFSR to generate pseudorandom numbers.

Function Documentation#

halStackSeedRandom#

void halStackSeedRandom (uint32_t seed)

Seeds the halCommonGetRandom() pseudorandom number generator.

Parameters
N/Aseed

A seed for the pseudorandom number generator.

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


Definition at line 42 of file platform/service/legacy_hal/inc/random.h

halCommonGetRandom#

uint16_t halCommonGetRandom (void )

Runs a standard LFSR to generate pseudorandom numbers.

Parameters
N/A

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.

Returns

  • random number.


Definition at line 54 of file platform/service/legacy_hal/inc/random.h