TSCH-RPL: configure callbacks automatically

This commit is contained in:
Simon Duquennoy 2017-10-12 12:22:39 +02:00
parent 1b97641e7f
commit a89df3b279
9 changed files with 42 additions and 54 deletions

View File

@ -43,21 +43,6 @@
#define WITH_SECURITY 0
#endif /* WITH_SECURITY */
/*******************************************************/
/********************* Enable TSCH *********************/
/*******************************************************/
/* TSCH and RPL callbacks */
#define RPL_CALLBACK_PARENT_SWITCH tsch_rpl_callback_parent_switch
#define RPL_CALLBACK_NEW_DIO_INTERVAL tsch_rpl_callback_new_dio_interval
#define TSCH_CALLBACK_KA_SENT tsch_rpl_callback_ka_sent
#define TSCH_CALLBACK_JOINING_NETWORK tsch_rpl_callback_joining_network
#define TSCH_CALLBACK_LEAVING_NETWORK tsch_rpl_callback_leaving_network
/*******************************************************/
/******************* Configure TSCH ********************/
/*******************************************************/
/* IEEE802.15.4 PANID */
#define IEEE802154_CONF_PANID 0x81a5

View File

@ -40,22 +40,6 @@
/* Save some space */
#define SICSLOWPAN_CONF_FRAG 0
#if MAC_CONF_WITH_TSCH
/*******************************************************/
/********************* Configure TSCH *********************/
/*******************************************************/
/* TSCH and RPL callbacks */
#define RPL_CALLBACK_PARENT_SWITCH tsch_rpl_callback_parent_switch
#define RPL_CALLBACK_NEW_DIO_INTERVAL tsch_rpl_callback_new_dio_interval
#define TSCH_CALLBACK_JOINING_NETWORK tsch_rpl_callback_joining_network
#define TSCH_CALLBACK_LEAVING_NETWORK tsch_rpl_callback_leaving_network
/*******************************************************/
/******************* Configure TSCH ********************/
/*******************************************************/
#endif /* MAC_CONF_WITH_TSCH */
/* Do not start TSCH at init, wait for NETSTACK_MAC.on() */
#define TSCH_CONF_AUTOSTART 0

View File

@ -47,12 +47,6 @@
/********************* Enable TSCH *********************/
/*******************************************************/
/* TSCH and RPL callbacks */
#define RPL_CALLBACK_PARENT_SWITCH tsch_rpl_callback_parent_switch
#define RPL_CALLBACK_NEW_DIO_INTERVAL tsch_rpl_callback_new_dio_interval
#define TSCH_CALLBACK_JOINING_NETWORK tsch_rpl_callback_joining_network
#define TSCH_CALLBACK_LEAVING_NETWORK tsch_rpl_callback_leaving_network
/* Needed for CC2538 platforms only */
/* For TSCH we have to use the more accurate crystal oscillator
* by default the RC oscillator is activated */

View File

@ -59,13 +59,6 @@
/********************* Configure TSCH *********************/
/*******************************************************/
/* TSCH and RPL callbacks */
#define RPL_CALLBACK_PARENT_SWITCH tsch_rpl_callback_parent_switch
#define RPL_CALLBACK_NEW_DIO_INTERVAL tsch_rpl_callback_new_dio_interval
#define TSCH_CALLBACK_KA_SENT tsch_rpl_callback_ka_sent
#define TSCH_CALLBACK_JOINING_NETWORK tsch_rpl_callback_joining_network
#define TSCH_CALLBACK_LEAVING_NETWORK tsch_rpl_callback_leaving_network
#if WITH_SHELL
/* Needed for CC2538 platforms, for serial */
#define USB_SERIAL_CONF_ENABLE 1

View File

@ -53,13 +53,6 @@
#define WITH_SECURITY 0
#endif /* WITH_SECURITY */
/* TSCH and RPL callbacks */
#define RPL_CALLBACK_PARENT_SWITCH tsch_rpl_callback_parent_switch
#define RPL_CALLBACK_NEW_DIO_INTERVAL tsch_rpl_callback_new_dio_interval
#define TSCH_CALLBACK_KA_SENT tsch_rpl_callback_ka_sent
#define TSCH_CALLBACK_JOINING_NETWORK tsch_rpl_callback_joining_network
#define TSCH_CALLBACK_LEAVING_NETWORK tsch_rpl_callback_leaving_network
/* Do not start TSCH at init, wait for NETSTACK_MAC.on() */
#define TSCH_CONF_AUTOSTART 0

View File

@ -50,9 +50,6 @@
#define TSCH_CONF_AUTOSTART 0
#define RPL_CALLBACK_PARENT_SWITCH tsch_rpl_callback_parent_switch
#define RPL_CALLBACK_NEW_DIO_INTERVAL tsch_rpl_callback_new_dio_interval
/* RPL Trickle timer tuning */
#define RPL_CONF_DIO_INTERVAL_MIN 12 /* 4.096 s */

View File

@ -163,6 +163,23 @@ frequency hopping for enhanced reliability.
/*********** Callbacks *********/
/* Link callbacks to RPL in case RPL is enabled */
#if UIP_CONF_IPV6_RPL
#ifndef TSCH_CALLBACK_JOINING_NETWORK
#define TSCH_CALLBACK_JOINING_NETWORK tsch_rpl_callback_joining_network
#endif /* TSCH_CALLBACK_JOINING_NETWORK */
#ifndef TSCH_CALLBACK_LEAVING_NETWORK
#define TSCH_CALLBACK_LEAVING_NETWORK tsch_rpl_callback_leaving_network
#endif /* TSCH_CALLBACK_LEAVING_NETWORK */
#ifndef TSCH_CALLBACK_KA_SENT
#define TSCH_CALLBACK_KA_SENT tsch_rpl_callback_ka_sent
#endif /* TSCH_CALLBACK_KA_SENT */
#endif /* UIP_CONF_IPV6_RPL */
/* Called by TSCH when joining a network */
#ifdef TSCH_CALLBACK_JOINING_NETWORK
void TSCH_CALLBACK_JOINING_NETWORK();

View File

@ -271,6 +271,18 @@ typedef struct rpl_stats rpl_stats_t;
extern rpl_stats_t rpl_stats;
#endif
/* RPL callbacks when TSCH is enabled */
#if MAC_CONF_WITH_TSCH
#ifndef RPL_CALLBACK_PARENT_SWITCH
#define RPL_CALLBACK_PARENT_SWITCH tsch_rpl_callback_parent_switch
#endif /* RPL_CALLBACK_PARENT_SWITCH */
#ifndef RPL_CALLBACK_NEW_DIO_INTERVAL
#define RPL_CALLBACK_NEW_DIO_INTERVAL tsch_rpl_callback_new_dio_interval
#endif /* RPL_CALLBACK_NEW_DIO_INTERVAL */
#endif /* MAC_CONF_WITH_TSCH */
/*---------------------------------------------------------------------------*/
/* RPL macros. */

View File

@ -382,6 +382,19 @@
#define RPL_PREFERENCE 0
#endif
/* RPL callbacks when TSCH is enabled */
#if MAC_CONF_WITH_TSCH
#ifndef RPL_CALLBACK_PARENT_SWITCH
#define RPL_CALLBACK_PARENT_SWITCH tsch_rpl_callback_parent_switch
#endif /* RPL_CALLBACK_PARENT_SWITCH */
#ifndef RPL_CALLBACK_NEW_DIO_INTERVAL
#define RPL_CALLBACK_NEW_DIO_INTERVAL tsch_rpl_callback_new_dio_interval
#endif /* RPL_CALLBACK_NEW_DIO_INTERVAL */
#endif /* MAC_CONF_WITH_TSCH */
/** @} */
#endif /* RPL_CONF_H */