Clean up setting channel and CCA-threshold for CC2420 based motes.

The CCA-threshold now defaults to -46 which give better simulation
results and typically also better experimental results.
This adjustment is also needed due to commit 0a13f99 in mspsim. As
promised in https://github.com/mspsim/mspsim/pull/18 it broke the
regression tests.
This commit is contained in:
Moritz 'Morty' Strübe 2013-11-07 15:17:38 +01:00
parent c89e827d6c
commit c67c048cac
9 changed files with 69 additions and 43 deletions

View file

@ -139,14 +139,12 @@ init_net(void)
cc2420_set_pan_addr(IEEE802154_PANID, shortaddr, longaddr);
}
cc2420_set_channel(RF_CHANNEL);
#if WITH_UIP6
memcpy(&uip_lladdr.addr, ds2401_id, sizeof(uip_lladdr.addr));
/* Setup nullmac-like MAC for 802.15.4 */
/* sicslowpan_init(sicslowmac_init(&cc2420_driver)); */
/* printf(" %s channel %u\n", sicslowmac_driver.name, RF_CHANNEL); */
/* printf(" %s channel %u\n", sicslowmac_driver.name, CC2420_CONF_CHANNEL); */
/* Setup X-MAC for 802.15.4 */
queuebuf_init();
@ -158,7 +156,7 @@ init_net(void)
NETSTACK_MAC.name, NETSTACK_RDC.name,
CLOCK_SECOND / (NETSTACK_RDC.channel_check_interval() == 0 ? 1:
NETSTACK_RDC.channel_check_interval()),
RF_CHANNEL);
CC2420_CONF_CHANNEL);
process_start(&tcpip_process, NULL);
@ -199,7 +197,7 @@ init_net(void)
NETSTACK_MAC.name, NETSTACK_RDC.name,
CLOCK_SECOND / (NETSTACK_RDC.channel_check_interval() == 0? 1:
NETSTACK_RDC.channel_check_interval()),
RF_CHANNEL);
CC2420_CONF_CHANNEL);
#endif /* WITH_UIP6 */