TSCH-RPL: configure callbacks automatically
This commit is contained in:
parent
1b97641e7f
commit
a89df3b279
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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 */
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
@ -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 */
|
||||
|
||||
|
@ -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();
|
||||
|
@ -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. */
|
||||
|
@ -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 */
|
||||
|
Loading…
Reference in New Issue
Block a user