Updated to match the new netstack api
This commit is contained in:
parent
51980f0be4
commit
459c550cbd
1 changed files with 8 additions and 5 deletions
|
@ -43,7 +43,10 @@
|
||||||
#include "dev/cc2420.h"
|
#include "dev/cc2420.h"
|
||||||
#include "net/mac/nullmac.h"
|
#include "net/mac/nullmac.h"
|
||||||
#include "net/mac/lpp.h"
|
#include "net/mac/lpp.h"
|
||||||
|
#include "net/mac/cxmac.h"
|
||||||
|
#include "net/mac/csma.h"
|
||||||
#include "net/rime.h"
|
#include "net/rime.h"
|
||||||
|
#include "net/netstack.h"
|
||||||
|
|
||||||
#ifndef RF_CHANNEL
|
#ifndef RF_CHANNEL
|
||||||
#define RF_CHANNEL 26
|
#define RF_CHANNEL 26
|
||||||
|
@ -55,11 +58,11 @@ init_net(void)
|
||||||
rimeaddr_t rimeaddr;
|
rimeaddr_t rimeaddr;
|
||||||
cc2420_init();
|
cc2420_init();
|
||||||
cc2420_set_channel(RF_CHANNEL);
|
cc2420_set_channel(RF_CHANNEL);
|
||||||
#if WITH_NULLMAC
|
|
||||||
rime_init(nullmac_init(&cc2420_driver));
|
NETSTACK_RDC.init();
|
||||||
#else
|
NETSTACK_MAC.init();
|
||||||
rime_init(lpp_init(&cc2420_driver));
|
NETSTACK_NETWORK.init();
|
||||||
#endif
|
|
||||||
rimeaddr.u8[0] = node_id & 0xff;
|
rimeaddr.u8[0] = node_id & 0xff;
|
||||||
rimeaddr.u8[1] = node_id >> 8;
|
rimeaddr.u8[1] = node_id >> 8;
|
||||||
rimeaddr_set_node_addr(&rimeaddr);
|
rimeaddr_set_node_addr(&rimeaddr);
|
||||||
|
|
Loading…
Reference in a new issue