Seed rand() with the node ID + MAC address
This commit is contained in:
parent
250ed0b910
commit
440899e4cb
1 changed files with 5 additions and 1 deletions
|
@ -26,7 +26,7 @@
|
||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* @(#)$Id: contiki-sky-main.c,v 1.45 2009/02/04 19:32:20 joxe Exp $
|
* @(#)$Id: contiki-sky-main.c,v 1.46 2009/02/07 16:49:36 adamdunkels Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
|
@ -55,6 +55,8 @@
|
||||||
|
|
||||||
#include "net/rime.h"
|
#include "net/rime.h"
|
||||||
|
|
||||||
|
#include "lib/rand.h"
|
||||||
|
|
||||||
#include "node-id.h"
|
#include "node-id.h"
|
||||||
#include "cfs-coffee-arch.h"
|
#include "cfs-coffee-arch.h"
|
||||||
#include "cfs/cfs-coffee.h"
|
#include "cfs/cfs-coffee.h"
|
||||||
|
@ -237,6 +239,8 @@ main(int argc, char **argv)
|
||||||
rime_init(xmac_init(&cc2420_driver));
|
rime_init(xmac_init(&cc2420_driver));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
srand(ds2411_id[0] + node_id);
|
||||||
|
|
||||||
printf(CONTIKI_VERSION_STRING " started. ");
|
printf(CONTIKI_VERSION_STRING " started. ");
|
||||||
if(node_id > 0) {
|
if(node_id > 0) {
|
||||||
printf("Node id is set to %u.\n", node_id);
|
printf("Node id is set to %u.\n", node_id);
|
||||||
|
|
Loading…
Reference in a new issue