Autoconfigure Orchestra whenever the module is included

This commit is contained in:
Simon Duquennoy 2017-10-12 16:59:28 +02:00
parent 81fe587574
commit 663d1f121d
22 changed files with 84 additions and 63 deletions

View File

@ -68,6 +68,9 @@
#include "reg.h"
#include "ieee-addr.h"
#include "lpm.h"
#if BUILD_WITH_ORCHESTRA
#include "orchestra.h"
#endif /* BUILD_WITH_ORCHESTRA */
#if BUILD_WITH_SHELL
#include "serial-shell.h"
#endif /* BUILD_WITH_SHELL */
@ -227,6 +230,9 @@ main(void)
energest_init();
ENERGEST_ON(ENERGEST_TYPE_CPU);
#if BUILD_WITH_ORCHESTRA
orchestra_init();
#endif /* BUILD_WITH_ORCHESTRA */
#if BUILD_WITH_SHELL
serial_shell_init();
#endif /* BUILD_WITH_SHELL */

View File

@ -61,6 +61,9 @@
#include "dev/vib-sensor.h"
#include "sys/node-id.h"
#if BUILD_WITH_ORCHESTRA
#include "orchestra.h"
#endif /* BUILD_WITH_ORCHESTRA */
#if BUILD_WITH_SHELL
#include "serial-shell.h"
#endif /* BUILD_WITH_SHELL */
@ -260,6 +263,9 @@ contiki_init()
/* Start serial process */
serial_line_init();
#if BUILD_WITH_ORCHESTRA
orchestra_init();
#endif /* BUILD_WITH_ORCHESTRA */
#if BUILD_WITH_SHELL
serial_shell_init();
#endif /* BUILD_WITH_SHELL */

View File

@ -96,6 +96,9 @@ extern uint32_t heap_location;
#include "experiment-setup.h"
#endif
#if BUILD_WITH_ORCHESTRA
#include "orchestra.h"
#endif /* BUILD_WITH_ORCHESTRA */
#if BUILD_WITH_SHELL
#include "serial-shell.h"
#endif /* BUILD_WITH_SHELL */
@ -350,6 +353,9 @@ main(void)
auto-start processes */
(void)u32AHI_Init();
#if BUILD_WITH_ORCHESTRA
orchestra_init();
#endif /* BUILD_WITH_ORCHESTRA */
#if BUILD_WITH_SHELL
serial_shell_init();
#endif /* BUILD_WITH_SHELL */

View File

@ -69,6 +69,9 @@
#include "net/ipv6/uip-ds6.h"
#endif /* NETSTACK_CONF_WITH_IPV6 */
#if BUILD_WITH_ORCHESTRA
#include "orchestra.h"
#endif /* BUILD_WITH_ORCHESTRA */
#if BUILD_WITH_SHELL
#include "serial-shell.h"
#endif /* BUILD_WITH_SHELL */
@ -278,6 +281,9 @@ main(int argc, char **argv)
serial_line_init();
#if BUILD_WITH_ORCHESTRA
orchestra_init();
#endif /* BUILD_WITH_ORCHESTRA */
#if BUILD_WITH_SHELL
serial_shell_init();
#endif /* BUILD_WITH_SHELL */

View File

@ -69,6 +69,9 @@
#endif
#endif
#if BUILD_WITH_ORCHESTRA
#include "orchestra.h"
#endif /* BUILD_WITH_ORCHESTRA */
#if BUILD_WITH_SHELL
#include "serial-shell.h"
#endif /* BUILD_WITH_SHELL */
@ -183,6 +186,9 @@ main(void)
process_start(&sensors_process, NULL);
#if BUILD_WITH_ORCHESTRA
orchestra_init();
#endif /* BUILD_WITH_ORCHESTRA */
#if BUILD_WITH_SHELL
serial_shell_init();
#endif /* BUILD_WITH_SHELL */

View File

@ -72,6 +72,9 @@
#include "ieee-addr.h"
#include "lpm.h"
#if BUILD_WITH_ORCHESTRA
#include "orchestra.h"
#endif /* BUILD_WITH_ORCHESTRA */
#if BUILD_WITH_SHELL
#include "serial-shell.h"
#endif /* BUILD_WITH_SHELL */
@ -224,6 +227,9 @@ main(void)
energest_init();
ENERGEST_ON(ENERGEST_TYPE_CPU);
#if BUILD_WITH_ORCHESTRA
orchestra_init();
#endif /* BUILD_WITH_ORCHESTRA */
#if BUILD_WITH_SHELL
serial_shell_init();
#endif /* BUILD_WITH_SHELL */

View File

@ -53,6 +53,9 @@
#include "cfs/cfs-coffee.h"
#include "sys/autostart.h"
#if BUILD_WITH_ORCHESTRA
#include "orchestra.h"
#endif /* BUILD_WITH_ORCHESTRA */
#if BUILD_WITH_SHELL
#include "serial-shell.h"
#endif /* BUILD_WITH_SHELL */
@ -310,6 +313,9 @@ main(int argc, char **argv)
watchdog_start();
#if BUILD_WITH_ORCHESTRA
orchestra_init();
#endif /* BUILD_WITH_ORCHESTRA */
#if BUILD_WITH_SHELL
serial_shell_init();
#endif /* BUILD_WITH_SHELL */

View File

@ -71,6 +71,9 @@
#include "driverlib/driverlib_release.h"
#if BUILD_WITH_ORCHESTRA
#include "orchestra.h"
#endif /* BUILD_WITH_ORCHESTRA */
#if BUILD_WITH_SHELL
#include "serial-shell.h"
#endif /* BUILD_WITH_SHELL */
@ -230,6 +233,9 @@ main(void)
process_start(&sensors_process, NULL);
#if BUILD_WITH_ORCHESTRA
orchestra_init();
#endif /* BUILD_WITH_ORCHESTRA */
#if BUILD_WITH_SHELL
serial_shell_init();
#endif /* BUILD_WITH_SHELL */

View File

@ -71,6 +71,9 @@
#include "ieee-addr.h"
#include "lpm.h"
#include "sys/autostart.h"
#if BUILD_WITH_ORCHESTRA
#include "orchestra.h"
#endif /* BUILD_WITH_ORCHESTRA */
#if BUILD_WITH_SHELL
#include "serial-shell.h"
#endif /* BUILD_WITH_SHELL */
@ -289,6 +292,9 @@ main(void)
energest_init();
ENERGEST_ON(ENERGEST_TYPE_CPU);
#if BUILD_WITH_ORCHESTRA
orchestra_init();
#endif /* BUILD_WITH_ORCHESTRA */
#if BUILD_WITH_SHELL
serial_shell_init();
#endif /* BUILD_WITH_SHELL */

View File

@ -41,7 +41,6 @@
/*******************************************************/
#define UIP_CONF_MAX_ROUTES 0 /* No need for routes */
#define RPL_CONF_MOP RPL_MOP_NON_STORING /* Mode of operation*/
#define ORCHESTRA_CONF_RULES { &eb_per_time_source, &unicast_per_neighbor_rpl_ns, &default_common } /* Orchestra in non-storing */
/*******************************************************/
/********************* Enable TSCH *********************/

View File

@ -8,10 +8,10 @@ MAKE_WITH_SECURITY ?= 0 # force Security from command line
MAKE_WITH_PERIODIC_ROUTES_PRINT ?= 0 # print #routes periodically, used for regression tests
MAKE_MAC = MAKE_MAC_TSCH
MODULES += os/services/shell os/services/orchestra
MODULES += os/services/shell
ifeq ($(MAKE_WITH_ORCHESTRA),1)
CFLAGS += -DWITH_ORCHESTRA=1
MODULES += os/services/orchestra
endif
ifeq ($(MAKE_WITH_SECURITY),1)

View File

@ -47,9 +47,6 @@
#if UIP_CONF_IPV6_RPL_LITE == 0
#include "rpl-private.h"
#endif /* UIP_CONF_IPV6_RPL_LITE == 0 */
#if WITH_ORCHESTRA
#include "orchestra.h"
#endif /* WITH_ORCHESTRA */
#if WITH_SHELL
#include "serial-shell.h"
#endif /* WITH_SHELL */
@ -85,10 +82,6 @@ PROCESS_THREAD(node_process, ev, data)
}
NETSTACK_MAC.on();
#if WITH_ORCHESTRA
orchestra_init();
#endif /* WITH_ORCHESTRA */
#if WITH_PERIODIC_ROUTES_PRINT
{
static struct etimer et;

View File

@ -38,11 +38,6 @@
/* Set to use the Contiki shell */
#define WITH_SHELL 1
/* Set to run orchestra */
#ifndef WITH_ORCHESTRA
#define WITH_ORCHESTRA 0
#endif /* WITH_ORCHESTRA */
/* Set to enable TSCH security */
#ifndef WITH_SECURITY
#define WITH_SECURITY 0
@ -53,7 +48,6 @@
/*******************************************************/
#define RPL_CONF_MOP RPL_MOP_NON_STORING /* Mode of operation*/
#define ORCHESTRA_CONF_RULES { &eb_per_time_source, &unicast_per_neighbor_rpl_ns, &default_common } /* Orchestra in non-storing */
/*******************************************************/
/********************* Configure TSCH *********************/
@ -88,19 +82,6 @@
#endif /* WITH_SECURITY */
#if WITH_ORCHESTRA
/* See os/services//orchestra/README.md for more Orchestra configuration options */
#define TSCH_SCHEDULE_CONF_WITH_6TISCH_MINIMAL 0 /* No 6TiSCH minimal schedule */
#define TSCH_CONF_WITH_LINK_SELECTOR 1 /* Orchestra requires per-packet link selection */
/* Orchestra callbacks */
#define TSCH_CALLBACK_NEW_TIME_SOURCE orchestra_callback_new_time_source
#define TSCH_CALLBACK_PACKET_READY orchestra_callback_packet_ready
#define NETSTACK_CONF_ROUTING_NEIGHBOR_ADDED_CALLBACK orchestra_callback_child_added
#define NETSTACK_CONF_ROUTING_NEIGHBOR_REMOVED_CALLBACK orchestra_callback_child_removed
#endif /* WITH_ORCHESTRA */
/*******************************************************/
/************* Other system configuration **************/
/*******************************************************/

View File

@ -43,11 +43,6 @@
#elif MAC_CONFIG == MAC_CONFIG_TSCH
/* Set to run orchestra */
#ifndef WITH_ORCHESTRA
#define WITH_ORCHESTRA 0
#endif /* WITH_ORCHESTRA */
/* Set to enable TSCH security */
#ifndef WITH_SECURITY
#define WITH_SECURITY 0
@ -67,20 +62,6 @@
#endif /* WITH_SECURITY */
#if WITH_ORCHESTRA
/* See os/services/orchestra/README.md for more Orchestra configuration options */
#define TSCH_SCHEDULE_CONF_WITH_6TISCH_MINIMAL 0 /* No 6TiSCH minimal schedule */
#define TSCH_CONF_WITH_LINK_SELECTOR 1 /* Orchestra requires per-packet link selection */
/* Orchestra callbacks */
#define TSCH_CALLBACK_NEW_TIME_SOURCE orchestra_callback_new_time_source
#define TSCH_CALLBACK_PACKET_READY orchestra_callback_packet_ready
#define NETSTACK_CONF_ROUTING_NEIGHBOR_ADDED_CALLBACK orchestra_callback_child_added
#define NETSTACK_CONF_ROUTING_NEIGHBOR_REMOVED_CALLBACK orchestra_callback_child_removed
#endif /* WITH_ORCHESTRA */
#else
#error Unsupported MAC configuration

View File

@ -58,13 +58,6 @@
#define TSCH_CONF_EB_PERIOD (4 * CLOCK_SECOND)
#define TSCH_CONF_KEEPALIVE_TIMEOUT (24 * CLOCK_SECOND)
#define TSCH_SCHEDULE_CONF_WITH_6TISCH_MINIMAL 0
#define TSCH_CONF_WITH_LINK_SELECTOR 1
#define TSCH_CALLBACK_NEW_TIME_SOURCE orchestra_callback_new_time_source
#define TSCH_CALLBACK_PACKET_READY orchestra_callback_packet_ready
#define NETSTACK_CONF_ROUTING_NEIGHBOR_ADDED_CALLBACK orchestra_callback_child_added
#define NETSTACK_CONF_ROUTING_NEIGHBOR_REMOVED_CALLBACK orchestra_callback_child_removed
/* Dimensioning */
#define ORCHESTRA_CONF_EBSF_PERIOD 41
#define ORCHESTRA_CONF_COMMON_SHARED_PERIOD 7 /* Common shared slot, 7 is a very short slotframe (high energy, high capacity). Must be prime and at least equal to number of nodes (incl. BR) */

View File

@ -38,7 +38,6 @@
#include "net/ipv6/uip.h"
#include "rpl.h"
#include "rpl-dag-root.h"
#include "orchestra.h"
#include <string.h>
#include <stdio.h>
@ -109,10 +108,6 @@ print_local_addresses(void)
void
rpl_tools_init(uip_ipaddr_t *br_prefix)
{
#if TSCH_CONFIG == TSCH_CONFIG_ORCHESTRA
orchestra_init();
#endif
if(br_prefix) { /* We are root */
rpl_dag_root_init(br_prefix, NULL);
rpl_dag_root_init_dag_immediately();

View File

@ -51,6 +51,18 @@
#define LOG_MODULE "IPv6 Route"
#define LOG_LEVEL LOG_LEVEL_IPV6
#if BUILD_WITH_ORCHESTRA
#ifndef NETSTACK_CONF_ROUTING_NEIGHBOR_ADDED_CALLBACK
#define NETSTACK_CONF_ROUTING_NEIGHBOR_ADDED_CALLBACK orchestra_callback_child_added
#endif /* NETSTACK_CONF_ROUTING_NEIGHBOR_ADDED_CALLBACK */
#ifndef NETSTACK_CONF_ROUTING_NEIGHBOR_REMOVED_CALLBACK
#define NETSTACK_CONF_ROUTING_NEIGHBOR_REMOVED_CALLBACK orchestra_callback_child_removed
#endif /* NETSTACK_CONF_ROUTING_NEIGHBOR_REMOVED_CALLBACK */
#endif /* BUILD_WITH_ORCHESTRA */
/* A configurable function called after adding a new neighbor as next hop */
#ifdef NETSTACK_CONF_ROUTING_NEIGHBOR_ADDED_CALLBACK
void NETSTACK_CONF_ROUTING_NEIGHBOR_ADDED_CALLBACK(const linkaddr_t *addr);

View File

@ -172,7 +172,7 @@
#ifdef TSCH_CONF_WITH_LINK_SELECTOR
#define TSCH_WITH_LINK_SELECTOR TSCH_CONF_WITH_LINK_SELECTOR
#else /* TSCH_CONF_WITH_LINK_SELECTOR */
#define TSCH_WITH_LINK_SELECTOR 0
#define TSCH_WITH_LINK_SELECTOR (BUILD_WITH_ORCHESTRA)
#endif /* TSCH_CONF_WITH_LINK_SELECTOR */
/* Estimate the drift of the time-source neighbor and compensate for it? */

View File

@ -104,6 +104,18 @@
/*********** Callbacks *********/
#if BUILD_WITH_ORCHESTRA
#ifndef TSCH_CALLBACK_NEW_TIME_SOURCE
#define TSCH_CALLBACK_NEW_TIME_SOURCE orchestra_callback_new_time_source
#endif /* TSCH_CALLBACK_NEW_TIME_SOURCE */
#ifndef TSCH_CALLBACK_PACKET_READY
#define TSCH_CALLBACK_PACKET_READY orchestra_callback_packet_ready
#endif /* TSCH_CALLBACK_PACKET_READY */
#endif /* BUILD_WITH_ORCHESTRA */
/* Called by TSCH when switching time source */
#ifdef TSCH_CALLBACK_NEW_TIME_SOURCE
struct tsch_neighbor;

View File

@ -53,7 +53,7 @@
#ifdef TSCH_SCHEDULE_CONF_WITH_6TISCH_MINIMAL
#define TSCH_SCHEDULE_WITH_6TISCH_MINIMAL TSCH_SCHEDULE_CONF_WITH_6TISCH_MINIMAL
#else
#define TSCH_SCHEDULE_WITH_6TISCH_MINIMAL 1
#define TSCH_SCHEDULE_WITH_6TISCH_MINIMAL (!(BUILD_WITH_ORCHESTRA))
#endif
/* 6TiSCH Minimal schedule slotframe length */

View File

@ -0,0 +1 @@
CFLAGS += -DBUILD_WITH_ORCHESTRA=1

View File

@ -46,7 +46,7 @@
* - a sender-based or receiver-based slotframe for unicast to RPL parents and children
* - a common shared slotframe for any other traffic (mostly broadcast)
* */
#define ORCHESTRA_RULES { &eb_per_time_source, &unicast_per_neighbor_rpl_storing, &default_common }
#define ORCHESTRA_RULES { &eb_per_time_source, &unicast_per_neighbor_rpl_ns, &default_common }
/* Example configuration for RPL non-storing mode: */
/* #define ORCHESTRA_RULES { &eb_per_time_source, &unicast_per_neighbor_rpl_ns, &default_common } */