Added uip-over-mesh, bugfixes, printing of statistics, renamed init() function to netsim_init()
This commit is contained in:
parent
eea7f463d7
commit
1b762247fa
12 changed files with 128 additions and 148 deletions
|
@ -30,11 +30,12 @@
|
|||
*
|
||||
* Author: Adam Dunkels <adam@sics.se>
|
||||
*
|
||||
* $Id: node.c,v 1.4 2007/03/13 13:07:48 adamdunkels Exp $
|
||||
* $Id: node.c,v 1.5 2007/03/22 18:59:34 adamdunkels Exp $
|
||||
*/
|
||||
#include "node.h"
|
||||
#include "contiki.h"
|
||||
#include "net/uip.h"
|
||||
#include "net/rime.h"
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
|
@ -58,11 +59,22 @@ node_init(int id, int posx, int posy, int b)
|
|||
/* node.type = NODE_TYPE_NORMAL;*/
|
||||
|
||||
if(b) {
|
||||
uip_ipaddr(&addr, 192,168,250,2);
|
||||
uip_ipaddr(&addr, 192,168,1,2);
|
||||
} else {
|
||||
uip_ipaddr(&addr, 10,10,posx,posy);
|
||||
uip_ipaddr(&addr, 172,16,posx,posy);
|
||||
|
||||
}
|
||||
uip_sethostaddr(&addr);
|
||||
|
||||
{
|
||||
rimeaddr_t nodeaddr;
|
||||
|
||||
nodeaddr.u8[0] = posx;
|
||||
nodeaddr.u8[1] = posy;
|
||||
rimeaddr_set_node_addr(&nodeaddr);
|
||||
}
|
||||
|
||||
|
||||
|
||||
drift = random() % 95726272;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue