Contiki 3.x
Functions
random.c File Reference

    Simple linear-congruential generator generic C implementation.
More...

#include <stdint.h>
#include "random.h"

Go to the source code of this file.

Functions

void random_init (RAND_SEED_TYPE seed)
 Initialize the PRNG. More...
 
RAND_RETURN_TYPE random_rand (void)
 Generate the next state and return the upper part of it.
 

Detailed Description

    Simple linear-congruential generator generic C implementation.
Authors
Joakim Gebart joaki.nosp@m.m.ge.nosp@m.bart@.nosp@m.eist.nosp@m.ec.se

Definition in file random.c.

Function Documentation

void random_init ( RAND_SEED_TYPE  seed)

Initialize the PRNG.

Note
seed is only a short (likely 16 bits), but the saved state is actually 32 bits.
Todo:
Use CPU UUID for additional random seeding

Definition at line 62 of file random.c.