Interface: tos.interfaces.Random

interface Random

This is the interface to a simple pseudorandom number generator. Currently this interface is implemented by the RandomLFSR, which uses a linear feedback shift register to generate the sequence and mote address to initialize the register.

Author:
Jason Hill
David Gay
Philip Levis
Alec Woo
Modified:
6/25/02

Commands
command result_t init() Initialize the random number generator
command uint16_t rand() Produces a 16-bit pseudorandom number.

Commands - Details

init

command result_t init()

Initialize the random number generator

Returns:
Returns SUCCESS if the initialization is successful, or FAIL if the initialization failed. For the currently existing implementations there is no known faliure modes.

rand

command uint16_t rand()

Produces a 16-bit pseudorandom number.

Returns:
Returns a 16-bit pseudorandom number.