diff --git a/Makefile.include b/Makefile.include index 314d0e84e..83f673cb0 100644 --- a/Makefile.include +++ b/Makefile.include @@ -118,7 +118,7 @@ ifeq ($(MAKE_MAC),MAKE_MAC_OTHER) CFLAGS += -DMAC_CONF_WITH_OTHER=1 endif -# Configure IPv6, RPL +# Configure Network layer MAKE_NET_NULLNET = 0 MAKE_NET_IPV6 = 1 @@ -133,8 +133,6 @@ endif ifeq ($(MAKE_NET),MAKE_NET_IPV6) CFLAGS += -DNETSTACK_CONF_WITH_IPV6=1 - CONTIKI_WITH_RPL ?= 1 - CONTIKI_WITH_RPL_LITE ?= 1 MODULES += os/net/ipv6 else CFLAGS += -DNETSTACK_CONF_WITH_NULLNET=1 @@ -145,28 +143,40 @@ ifeq ($(MAKE_NET),MAKE_NET_OTHER) CFLAGS += -DNETSTACK_CONF_WITH_OTHER=1 endif -ifeq ($(CONTIKI_WITH_RPL),1) - CFLAGS += -DUIP_CONF_IPV6_RPL=1 - ifeq ($(CONTIKI_WITH_RPL_LITE),1) - CFLAGS += -DUIP_CONF_IPV6_RPL_LITE=1 - MODULES += os/net/rpl-lite - else - MODULES += os/net/rpl-classic - endif -else - CFLAGS += -DUIP_CONF_IPV6_RPL=0 -endif - ifeq ($(WITH_IP64),1) MODULES += os/services/ip64 endif +# Configure Routing protocol +MAKE_ROUTING_NONE = 0 +MAKE_ROUTING_RPL_CLASSIC = 1 +MAKE_ROUTING_RPL_LITE = 2 + +# Default routing protocol: RPL for IPv6, None otherwise +ifeq ($(MAKE_NET),MAKE_NET_IPV6) +MAKE_ROUTING ?= MAKE_ROUTING_RPL_LITE +else +MAKE_ROUTING ?= MAKE_ROUTING_NONE +endif + +ifeq ($(MAKE_ROUTING),MAKE_ROUTING_RPL_CLASSIC) + CFLAGS += -DUIP_CONF_IPV6_RPL=1 + CFLAGS += -DUIP_CONF_IPV6_RPL_CLASSIC=1 + MODULES += os/net/rpl-classic +else ifeq ($(MAKE_ROUTING),MAKE_ROUTING_RPL_LITE) + CFLAGS += -DUIP_CONF_IPV6_RPL=1 + CFLAGS += -DUIP_CONF_IPV6_RPL_LITE=1 + MODULES += os/net/rpl-lite +else + CFLAGS += -DUIP_CONF_IPV6_RPL=0 +endif + ifdef MODULES UNIQUEMODULES = $(call uniq,$(MODULES)) MODULEDIRS = ${wildcard ${addprefix $(CONTIKI)/, $(UNIQUEMODULES)}} MODULES_SOURCES = ${foreach d, $(MODULEDIRS), ${subst ${d}/,,${wildcard $(d)/*.c}}} MODULES_INCLUDES = ${wildcard ${foreach d, $(MODULEDIRS), $(d)/Makefile.${notdir $(d)}}} - -include $(MODULE_INCLUDES) + include $(MODULES_INCLUDES) CONTIKI_SOURCEFILES += $(MODULES_SOURCES) endif @@ -363,8 +373,7 @@ viewconf: @echo "##### \"BOARD\": _________________________________ $(BOARD)" @echo "##### \"MAKE_MAC\": ______________________________ $(MAKE_MAC)" @echo "##### \"MAKE_NET\": ______________________________ $(MAKE_NET)" - @echo "##### \"CONTIKI_WITH_RPL\": ______________________ $(CONTIKI_WITH_RPL)" - @echo "##### \"CONTIKI_WITH_RPL_LITE\": _________________ $(CONTIKI_WITH_RPL_LITE)" + @echo "##### \"MAKE_ROUTING\": __________________________ $(MAKE_ROUTING)" @echo "----------------- C variables: -----------------" $(Q)$(CC) $(CFLAGS) -E $(CONTIKI)/tools/viewconf.c | grep \#\#\#\#\# @echo "------------------------------------------------" diff --git a/arch/platform/cc2538dk/contiki-conf.h b/arch/platform/cc2538dk/contiki-conf.h index cad72f1ca..b3719275e 100644 --- a/arch/platform/cc2538dk/contiki-conf.h +++ b/arch/platform/cc2538dk/contiki-conf.h @@ -230,8 +230,9 @@ typedef uint32_t rtimer_clock_t; */ #ifndef USB_SERIAL_CONF_ENABLE #define USB_SERIAL_CONF_ENABLE \ - ((SLIP_ARCH_CONF_USB & SLIP_ARCH_CONF_ENABLED) | \ - DBG_CONF_USB) + ((SLIP_ARCH_CONF_USB && SLIP_ARCH_CONF_ENABLED) || \ + (MAC_CONF_WITH_TSCH && (SLIP_ARCH_CONF_ENABLED || BUILD_WITH_SHELL)) || \ + DBG_CONF_USB) #endif /* diff --git a/arch/platform/cc2538dk/contiki-main.c b/arch/platform/cc2538dk/contiki-main.c index 3058b6257..4ac32a2af 100644 --- a/arch/platform/cc2538dk/contiki-main.c +++ b/arch/platform/cc2538dk/contiki-main.c @@ -68,6 +68,12 @@ #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 */ #include #include @@ -224,6 +230,13 @@ 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 */ + autostart_start(autostart_processes); watchdog_start(); diff --git a/arch/platform/cooja/Makefile.cooja b/arch/platform/cooja/Makefile.cooja index dd6d9fada..9f41dbaad 100644 --- a/arch/platform/cooja/Makefile.cooja +++ b/arch/platform/cooja/Makefile.cooja @@ -43,36 +43,6 @@ CONTIKI_APP_OBJ = $(CONTIKI_APP).co # Modules MODULES += os/net os/net/mac os/net/mac/framer -## Copied from Makefile.include, since Cooja overrides CFLAGS et al -MAKE_NET_NULLNET = 0 -MAKE_NET_IPV6 = 1 -MAKE_NET_OTHER = 2 - -# Make IPv6 the default stack -MAKE_NET ?= MAKE_NET_IPV6 - -ifeq ($(MAKE_NET),MAKE_NET_IPV6) - CFLAGS += -DNETSTACK_CONF_WITH_IPV6=1 - CONTIKI_WITH_RPL ?= 1 - CONTIKI_WITH_RPL_LITE ?= 1 - MODULES += os/net/ipv6 - COOJA_NET = uip-driver.c -else - COOJA_NET = -endif - -ifeq ($(CONTIKI_WITH_RPL),1) - CFLAGS += -DUIP_CONF_IPV6_RPL=1 - ifeq ($(CONTIKI_WITH_RPL_LITE),1) - CFLAGS += -DUIP_CONF_IPV6_RPL_LITE=1 - MODULES += os/net/rpl-lite - else - MODULES += os/net/rpl - endif -else - CFLAGS += -DUIP_CONF_IPV6_RPL=0 -endif - ### COOJA platform sources COOJA = $(CONTIKI)/arch/platform/$(TARGET) CONTIKI_TARGET_DIRS = . dev lib sys cfs net diff --git a/arch/platform/cooja/contiki-conf.h b/arch/platform/cooja/contiki-conf.h index 970eddbb8..44fe407f1 100644 --- a/arch/platform/cooja/contiki-conf.h +++ b/arch/platform/cooja/contiki-conf.h @@ -124,7 +124,6 @@ typedef uint64_t rtimer_clock_t; #define UIP_ARCH_IPCHKSUM 1 #if MAC_CONF_WITH_TSCH -#define COOJA_CONF_SIMULATE_TURNAROUND 0 /* A bug in cooja causes many EBs to be missed at scan. Increase EB frequency to shorten the join process */ #undef TSCH_CONF_EB_PERIOD diff --git a/arch/platform/cooja/contiki-cooja-main.c b/arch/platform/cooja/contiki-cooja-main.c index 278031ef2..f39d3fbb1 100644 --- a/arch/platform/cooja/contiki-cooja-main.c +++ b/arch/platform/cooja/contiki-cooja-main.c @@ -61,7 +61,12 @@ #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 */ /* JNI-defined functions, depends on the environment variable CLASSNAME */ #ifndef CLASSNAME @@ -258,6 +263,13 @@ 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 */ + /* Start autostart processes (defined in Contiki application) */ print_processes(autostart_processes); autostart_start(autostart_processes); diff --git a/arch/platform/cooja/dev/cooja-radio.h b/arch/platform/cooja/dev/cooja-radio.h index a65a61bb1..ee5e9097d 100644 --- a/arch/platform/cooja/dev/cooja-radio.h +++ b/arch/platform/cooja/dev/cooja-radio.h @@ -39,7 +39,7 @@ #ifdef COOJA_CONF_SIMULATE_TURNAROUND #define COOJA_SIMULATE_TURNAROUND COOJA_CONF_SIMULATE_TURNAROUND #else -#define COOJA_SIMULATE_TURNAROUND 1 +#define COOJA_SIMULATE_TURNAROUND (!(MAC_CONF_WITH_TSCH)) #endif #ifdef COOJA_CONF_TRANSMIT_ON_CCA diff --git a/arch/platform/jn516x/contiki-jn516x-main.c b/arch/platform/jn516x/contiki-jn516x-main.c index 7c8acb67a..af1ce5f94 100644 --- a/arch/platform/jn516x/contiki-jn516x-main.c +++ b/arch/platform/jn516x/contiki-jn516x-main.c @@ -96,6 +96,13 @@ 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 */ + /* _EXTRA_LPM is the sleep mode, _LPM is the doze mode */ #define ENERGEST_TYPE_EXTRA_LPM ENERGEST_TYPE_LPM @@ -346,6 +353,13 @@ 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 */ + start_autostart_processes(); leds_off(LEDS_ALL); diff --git a/arch/platform/native/contiki-main.c b/arch/platform/native/contiki-main.c index ca0638e94..344713479 100644 --- a/arch/platform/native/contiki-main.c +++ b/arch/platform/native/contiki-main.c @@ -69,6 +69,13 @@ #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 */ + #ifdef SELECT_CONF_MAX #define SELECT_MAX SELECT_CONF_MAX #else @@ -274,6 +281,13 @@ 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 */ + autostart_start(autostart_processes); /* Make standard output unbuffered. */ diff --git a/arch/platform/nrf52dk/contiki-main.c b/arch/platform/nrf52dk/contiki-main.c index 481f3655d..35d4ddf94 100644 --- a/arch/platform/nrf52dk/contiki-main.c +++ b/arch/platform/nrf52dk/contiki-main.c @@ -69,6 +69,13 @@ #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 */ + #if defined(SOFTDEVICE_PRESENT) && PLATFORM_INDICATE_BLE_STATE PROCESS(ble_iface_observer, "BLE interface observer"); @@ -178,6 +185,14 @@ main(void) #endif /* SOFTDEVICE_PRESENT */ 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 */ + autostart_start(autostart_processes); watchdog_start(); diff --git a/arch/platform/openmote-cc2538/contiki-conf.h b/arch/platform/openmote-cc2538/contiki-conf.h index d00836326..ea77d9cba 100644 --- a/arch/platform/openmote-cc2538/contiki-conf.h +++ b/arch/platform/openmote-cc2538/contiki-conf.h @@ -278,8 +278,9 @@ typedef uint32_t rtimer_clock_t; */ #ifndef USB_SERIAL_CONF_ENABLE #define USB_SERIAL_CONF_ENABLE \ - ((SLIP_ARCH_CONF_USB & SLIP_ARCH_CONF_ENABLED) | \ - DBG_CONF_USB) + ((SLIP_ARCH_CONF_USB && SLIP_ARCH_CONF_ENABLED) || \ + (MAC_CONF_WITH_TSCH && (SLIP_ARCH_CONF_ENABLED || BUILD_WITH_SHELL)) || \ + DBG_CONF_USB) #endif /* diff --git a/arch/platform/openmote-cc2538/contiki-main.c b/arch/platform/openmote-cc2538/contiki-main.c index 4afb4212b..8ddaeea73 100644 --- a/arch/platform/openmote-cc2538/contiki-main.c +++ b/arch/platform/openmote-cc2538/contiki-main.c @@ -72,6 +72,13 @@ #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 */ + #include #include #include @@ -220,6 +227,13 @@ 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 */ + autostart_start(autostart_processes); watchdog_start(); diff --git a/arch/platform/sky/contiki-sky-main.c b/arch/platform/sky/contiki-sky-main.c index 8b20c7cd5..106b58440 100644 --- a/arch/platform/sky/contiki-sky-main.c +++ b/arch/platform/sky/contiki-sky-main.c @@ -53,6 +53,13 @@ #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 */ + #if DCOSYNCH_CONF_ENABLED static struct timer mgt_timer; #endif @@ -306,6 +313,13 @@ 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 */ + #if !PROCESS_CONF_NO_PROCESS_NAMES print_processes(autostart_processes); #endif /* !PROCESS_CONF_NO_PROCESS_NAMES */ diff --git a/arch/platform/srf06-cc26xx/contiki-conf.h b/arch/platform/srf06-cc26xx/contiki-conf.h index 7cfc46801..bcf4f100f 100644 --- a/arch/platform/srf06-cc26xx/contiki-conf.h +++ b/arch/platform/srf06-cc26xx/contiki-conf.h @@ -55,7 +55,7 @@ * You need to set this to 1 to use TSCH with its default 2.2ms or larger guard time. */ #ifndef CC2650_FAST_RADIO_STARTUP -#define CC2650_FAST_RADIO_STARTUP 0 +#define CC2650_FAST_RADIO_STARTUP (MAC_CONF_WITH_TSCH) #endif #ifdef RF_CHANNEL diff --git a/arch/platform/srf06-cc26xx/contiki-main.c b/arch/platform/srf06-cc26xx/contiki-main.c index f399d1b9f..cfd33ea06 100644 --- a/arch/platform/srf06-cc26xx/contiki-main.c +++ b/arch/platform/srf06-cc26xx/contiki-main.c @@ -71,6 +71,13 @@ #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 */ + #include /*---------------------------------------------------------------------------*/ unsigned short node_id = 0; @@ -226,6 +233,13 @@ 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 */ + autostart_start(autostart_processes); watchdog_start(); diff --git a/arch/platform/zoul/contiki-conf.h b/arch/platform/zoul/contiki-conf.h index 93699c2e8..bc6ac2bd2 100644 --- a/arch/platform/zoul/contiki-conf.h +++ b/arch/platform/zoul/contiki-conf.h @@ -276,7 +276,8 @@ typedef uint32_t rtimer_clock_t; */ #ifndef USB_SERIAL_CONF_ENABLE #define USB_SERIAL_CONF_ENABLE \ - ((SLIP_ARCH_CONF_USB & SLIP_ARCH_CONF_ENABLED) | \ + ((SLIP_ARCH_CONF_USB && SLIP_ARCH_CONF_ENABLED) || \ + (MAC_CONF_WITH_TSCH && (SLIP_ARCH_CONF_ENABLED || BUILD_WITH_SHELL)) || \ DBG_CONF_USB) #endif diff --git a/arch/platform/zoul/contiki-main.c b/arch/platform/zoul/contiki-main.c index 42e832352..bd46cb809 100644 --- a/arch/platform/zoul/contiki-main.c +++ b/arch/platform/zoul/contiki-main.c @@ -71,6 +71,12 @@ #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 */ #include #include @@ -286,6 +292,13 @@ 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 */ + autostart_start(autostart_processes); watchdog_start(); diff --git a/examples/6tisch/6p-packet/Makefile b/examples/6tisch/6p-packet/Makefile index 3016d9c20..1ae6e34b5 100644 --- a/examples/6tisch/6p-packet/Makefile +++ b/examples/6tisch/6p-packet/Makefile @@ -4,6 +4,7 @@ PROJECT_SOURCEFILES += test-sf.c CONTIKI = ../../../ MAKE_MAC = MAKE_MAC_TSCH +MAKE_ROUTING = MAKE_ROUTING_NONE MODULES += os/net/mac/tsch/sixtop include $(CONTIKI)/Makefile.include diff --git a/examples/6tisch/6p-packet/project-conf.h b/examples/6tisch/6p-packet/project-conf.h index 0381217c6..1e8fc03e0 100644 --- a/examples/6tisch/6p-packet/project-conf.h +++ b/examples/6tisch/6p-packet/project-conf.h @@ -31,18 +31,9 @@ #ifndef _PROJECT_CONF_H_ #define _PROJECT_CONF_H_ -#define CONTIKI_WITH_RPL 0 -#define UIP_CONF_IPV6_RPL 0 #define UIP_CONF_ND6_SEND_RA 0 -#if CONTIKI_TARGET_COOJA -#define COOJA_CONF_SIMULATE_TURNAROUND 0 -#else -#error "This example is intended to be used for Cooja mote." -#endif /* CONTIKI_TARGET_COOJA */ - #define TSCH_CONF_WITH_SIXTOP 1 -#define TSCH_LOG_CONF_LEVEL 2 #define TSCH_CONF_AUTOSTART 1 #define TSCH_CONF_DEFAULT_HOPPING_SEQUENCE TSCH_HOPPING_SEQUENCE_1_1 diff --git a/examples/6tisch/etsi-plugtest-2017/project-conf.h b/examples/6tisch/etsi-plugtest-2017/project-conf.h index 894a49aba..751ccf977 100644 --- a/examples/6tisch/etsi-plugtest-2017/project-conf.h +++ b/examples/6tisch/etsi-plugtest-2017/project-conf.h @@ -35,29 +35,11 @@ #ifndef __PROJECT_CONF_H__ #define __PROJECT_CONF_H__ -/* Set to use the Contiki shell */ -#define WITH_SHELL 1 - /* Set to enable TSCH security */ #ifndef WITH_SECURITY #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 @@ -71,8 +53,7 @@ #if WITH_SECURITY /* Enable security */ #define LLSEC802154_CONF_ENABLED 1 -#define LLSEC802154_CONF_USES_EXPLICIT_KEYS 0 -#define LLSEC802154_CONF_USES_FRAME_COUNTER 0 + #define TSCH_SECURITY_CONF_K1 { 0x11, 0x11, 0x11, 0x11, \ 0x11, 0x11, 0x11, 0x11, \ 0x11, 0x11, 0x11, 0x11, \ @@ -108,36 +89,10 @@ /************* Platform dependent configuration ********/ /*******************************************************/ -#if CONTIKI_TARGET_CC2538DK || CONTIKI_TARGET_ZOUL || \ - CONTIKI_TARGET_OPENMOTE_CC2538 -#define TSCH_CONF_HW_FRAME_FILTERING 0 -#endif /* CONTIKI_TARGET_CC2538DK || CONTIKI_TARGET_ZOUL \ - || CONTIKI_TARGET_OPENMOTE_CC2538 */ - -/* Needed for CC2538 platforms only */ -/* For TSCH we have to use the more accurate crystal oscillator - * by default the RC oscillator is activated */ -#define SYS_CTRL_CONF_OSC32K_USE_XTAL 1 - -#define USB_SERIAL_CONF_ENABLE 1 /* USB serial takes space, free more space elsewhere */ #define SICSLOWPAN_CONF_FRAG 0 #define UIP_CONF_BUFFER_SIZE 160 -#if CONTIKI_TARGET_SRF06_CC26XX -#define CC2650_FAST_RADIO_STARTUP 1 -#endif /* CONTIK_TARGET_SRF06_CC26XX */ - -#if CONTIKI_TARGET_COOJA -#define COOJA_CONF_SIMULATE_TURNAROUND 0 -#endif /* CONTIKI_TARGET_COOJA */ - -/* Needed for cc2420 platforms only */ -/* Disable DCO calibration (uses timerB) */ -#define DCOSYNCH_CONF_ENABLED 0 -/* Enable SFD timestamps (uses timerB) */ -#define CC2420_CONF_SFD_TIMESTAMPS 1 - /*******************************************************/ /******************* Configure 6LoWPAN/IPv6 ************/ /*******************************************************/ diff --git a/examples/http-socket/Makefile b/examples/http-socket/Makefile index e63dacd84..6498ddacf 100644 --- a/examples/http-socket/Makefile +++ b/examples/http-socket/Makefile @@ -2,5 +2,5 @@ all: http-example CONTIKI=../.. MODULES += os/net/app-layer/http-socket -CONTIKI_WITH_RPL_LITE = 0 +MAKE_ROUTING = MAKE_ROUTING_RPL_CLASSIC include $(CONTIKI)/Makefile.include diff --git a/examples/ipv6/multicast/Makefile b/examples/ipv6/multicast/Makefile index deff389b5..310177870 100644 --- a/examples/ipv6/multicast/Makefile +++ b/examples/ipv6/multicast/Makefile @@ -5,5 +5,5 @@ CONTIKI = ../../.. MODULES += os/net/ipv6/multicast -CONTIKI_WITH_RPL_LITE = 1 +MAKE_ROUTING = MAKE_ROUTING_RPL_CLASSIC include $(CONTIKI)/Makefile.include diff --git a/examples/ipv6/rpl-simple/project-conf.h b/examples/ipv6/rpl-simple/project-conf.h index b5c3c9991..2a8b376f4 100644 --- a/examples/ipv6/rpl-simple/project-conf.h +++ b/examples/ipv6/rpl-simple/project-conf.h @@ -40,25 +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 */ - -/* TSCH per-slot logging */ -#define TSCH_LOG_CONF_PER_SLOT 1 - /* Do not start TSCH at init, wait for NETSTACK_MAC.on() */ #define TSCH_CONF_AUTOSTART 0 diff --git a/examples/ipv6/rpl-tsch-sixtop/project-conf.h b/examples/ipv6/rpl-tsch-sixtop/project-conf.h index 3fa3d548a..ff8b96ad7 100755 --- a/examples/ipv6/rpl-tsch-sixtop/project-conf.h +++ b/examples/ipv6/rpl-tsch-sixtop/project-conf.h @@ -41,18 +41,11 @@ /*******************************************************/ #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 *********************/ /*******************************************************/ -/* 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 */ @@ -71,9 +64,6 @@ /******************* Configure TSCH ********************/ /*******************************************************/ -/* TSCH logging. */ -#define TSCH_LOG_CONF_PER_SLOT 1 - /* IEEE802.15.4 PANID */ #define IEEE802154_CONF_PANID 0xabcd @@ -87,10 +77,6 @@ /* Enable security */ #define LLSEC802154_CONF_ENABLED 1 -/* TSCH uses explicit keys to identify k1 and k2 */ -#define LLSEC802154_CONF_USES_EXPLICIT_KEYS 1 -/* TSCH uses the ASN rather than frame counter to construct the Nonce */ -#define LLSEC802154_CONF_USES_FRAME_COUNTER 0 #endif /* WITH_SECURITY */ @@ -113,8 +99,6 @@ * a very short 6TiSCH minimal schedule length */ #define TSCH_CONF_DEFAULT_TIMESLOT_LENGTH 65000 #define TSCH_SCHEDULE_CONF_DEFAULT_LENGTH 2 -/* Reduce log level to make space for security on z1 */ -#define TSCH_LOG_CONF_LEVEL 0 #endif /* WITH_SECURITY */ #endif /* CONTIKI_TARGET_Z1 */ diff --git a/examples/ipv6/rpl-tsch/Makefile b/examples/ipv6/rpl-tsch/Makefile index 1986812ce..e6cb76944 100644 --- a/examples/ipv6/rpl-tsch/Makefile +++ b/examples/ipv6/rpl-tsch/Makefile @@ -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) diff --git a/examples/ipv6/rpl-tsch/node.c b/examples/ipv6/rpl-tsch/node.c index 297c46637..9884b4e0e 100644 --- a/examples/ipv6/rpl-tsch/node.c +++ b/examples/ipv6/rpl-tsch/node.c @@ -47,12 +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 */ #define DEBUG DEBUG_PRINT #include "net/ipv6/uip-debug.h" @@ -70,12 +64,6 @@ PROCESS_THREAD(node_process, ev, data) is_coordinator = 0; -#if WITH_SHELL - serial_shell_init(); - log_set_level("all", LOG_LEVEL_WARN); - tsch_log_stop(); -#endif /* WITH_SHELL */ - #if CONTIKI_TARGET_COOJA is_coordinator = (node_id == 1); #endif @@ -85,10 +73,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; diff --git a/examples/ipv6/rpl-tsch/project-conf.h b/examples/ipv6/rpl-tsch/project-conf.h index f3becfc5c..a46792fea 100644 --- a/examples/ipv6/rpl-tsch/project-conf.h +++ b/examples/ipv6/rpl-tsch/project-conf.h @@ -35,14 +35,6 @@ #ifndef __PROJECT_CONF_H__ #define __PROJECT_CONF_H__ -/* 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,29 +45,11 @@ /*******************************************************/ #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 *********************/ -/*******************************************************/ - -/* 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 /* USB serial takes space, free more space elsewhere */ #define SICSLOWPAN_CONF_FRAG 0 #define UIP_CONF_BUFFER_SIZE 160 -#endif /* WITH_SHELL */ - /*******************************************************/ /******************* Configure TSCH ********************/ /*******************************************************/ @@ -97,19 +71,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 **************/ /*******************************************************/ diff --git a/examples/ipv6/slip-radio/Makefile b/examples/ipv6/slip-radio/Makefile index 014f0f9c8..f5e3ffac6 100644 --- a/examples/ipv6/slip-radio/Makefile +++ b/examples/ipv6/slip-radio/Makefile @@ -18,5 +18,5 @@ endif # custom net layer, but with IPv6 enabled MAKE_NET = MAKE_NET_IPV6 -CONTIKI_WITH_RPL = 0 +MAKE_ROUTING = MAKE_ROUTING_NONE include $(CONTIKI)/Makefile.include diff --git a/examples/platform-specific/jn516x/rpl/common-conf.h b/examples/platform-specific/jn516x/rpl/common-conf.h index fb7b0d51c..daa66ae29 100644 --- a/examples/platform-specific/jn516x/rpl/common-conf.h +++ b/examples/platform-specific/jn516x/rpl/common-conf.h @@ -43,26 +43,11 @@ #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 #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 - -/* TSCH per-slot logging */ -#define TSCH_LOG_CONF_PER_SLOT 1 - /* Do not start TSCH at init, wait for NETSTACK_MAC.on() */ #define TSCH_CONF_AUTOSTART 0 @@ -77,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 diff --git a/examples/platform-specific/jn516x/tsch/common-conf.h b/examples/platform-specific/jn516x/tsch/common-conf.h index 28c5e2835..39d012d52 100644 --- a/examples/platform-specific/jn516x/tsch/common-conf.h +++ b/examples/platform-specific/jn516x/tsch/common-conf.h @@ -37,7 +37,6 @@ /* Global config flags */ #define WITH_TSCH_SECURITY 0 -#define TSCH_LOG_CONF_PER_SLOT 1 #define WITH_COAP_RESOURCES 0 #define ENABLE_COOJA_DEBUG 0 @@ -51,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 */ @@ -62,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) */ diff --git a/examples/platform-specific/jn516x/tsch/tools/rpl-tools.c b/examples/platform-specific/jn516x/tsch/tools/rpl-tools.c index 7973982ff..e71a19bc9 100644 --- a/examples/platform-specific/jn516x/tsch/tools/rpl-tools.c +++ b/examples/platform-specific/jn516x/tsch/tools/rpl-tools.c @@ -38,7 +38,6 @@ #include "net/ipv6/uip.h" #include "rpl.h" #include "rpl-dag-root.h" -#include "orchestra.h" #include #include @@ -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(); diff --git a/examples/platform-specific/nrf52dk/blink-hello/Makefile b/examples/platform-specific/nrf52dk/blink-hello/Makefile index 390ef5cfe..7d1db9716 100644 --- a/examples/platform-specific/nrf52dk/blink-hello/Makefile +++ b/examples/platform-specific/nrf52dk/blink-hello/Makefile @@ -1,9 +1,9 @@ CONTIKI_PROJECT = blink-hello -CONTIKI_WITH_RPL=0 +MAKE_ROUTING = MAKE_ROUTING_NONE NRF52_WITHOUT_SOFTDEVICE=1 -all: $(CONTIKI_PROJECT) +all: $(CONTIKI_PROJECT) CONTIKI = ../../../.. include $(CONTIKI)/Makefile.include diff --git a/examples/platform-specific/nrf52dk/coap-demo/Makefile b/examples/platform-specific/nrf52dk/coap-demo/Makefile index 381c5af19..6d9639da0 100644 --- a/examples/platform-specific/nrf52dk/coap-demo/Makefile +++ b/examples/platform-specific/nrf52dk/coap-demo/Makefile @@ -25,6 +25,6 @@ PROJECT_SOURCEFILES += $(REST_RESOURCES_FILES) # REST Engine shall use Erbium CoAP implementation MODULES += os/net/app-layer/coap -CONTIKI_WITH_RPL = 0 +MAKE_ROUTING = MAKE_ROUTING_NONE include $(CONTIKI)/Makefile.include diff --git a/examples/platform-specific/nrf52dk/mqtt-demo/Makefile b/examples/platform-specific/nrf52dk/mqtt-demo/Makefile index f267df433..bf1b35fff 100644 --- a/examples/platform-specific/nrf52dk/mqtt-demo/Makefile +++ b/examples/platform-specific/nrf52dk/mqtt-demo/Makefile @@ -1,6 +1,6 @@ all: mqtt-demo -CONTIKI_WITH_RPL = 0 +MAKE_ROUTING = MAKE_ROUTING_NONE MODULES += os/net/app-layer/mqtt diff --git a/examples/platform-specific/nrf52dk/timer-test/Makefile b/examples/platform-specific/nrf52dk/timer-test/Makefile index 7d2507558..b5d0be8a2 100644 --- a/examples/platform-specific/nrf52dk/timer-test/Makefile +++ b/examples/platform-specific/nrf52dk/timer-test/Makefile @@ -1,9 +1,9 @@ CONTIKI_PROJECT = timer-test -CONTIKI_WITH_RPL=0 +MAKE_ROUTING = MAKE_ROUTING_NONE NRF52_WITHOUT_SOFTDEVICE=1 -all: $(CONTIKI_PROJECT) +all: $(CONTIKI_PROJECT) CONTIKI = ../../../.. include $(CONTIKI)/Makefile.include diff --git a/os/contiki-default-conf.h b/os/contiki-default-conf.h index 0a93a4313..0395f6ca4 100644 --- a/os/contiki-default-conf.h +++ b/os/contiki-default-conf.h @@ -33,12 +33,14 @@ #define CONTIKI_DEFAULT_CONF_H /*---------------------------------------------------------------------------*/ -/* Packet buffer size options. - * - * The packet buffer size options can be tweaked on a per-project - * basis to reduce memory consumption. +/* Link-layer options */ +/* IEEE802154_CONF_PANID defines the default PAN ID for IEEE 802.15.4 networks */ +#ifndef IEEE802154_CONF_PANID +#define IEEE802154_CONF_PANID 0xabcd +#endif /* IEEE802154_CONF_PANID */ + /* QUEUEBUF_CONF_NUM specifies the number of queue buffers. Queue buffers are used throughout the Contiki netstack but the configuration option can be tweaked to save memory. Performance can @@ -107,13 +109,21 @@ /* UIP_CONF_TCP_CONNS specifies the maximum number of simultaneous TCP connections. */ #ifndef UIP_CONF_TCP_CONNS +#if UIP_CONF_TCP #define UIP_CONF_TCP_CONNS 8 +#else /* UIP_CONF_TCP */ +#define UIP_CONF_TCP_CONNS 0 +#endif /* UIP_CONF_TCP */ #endif /* UIP_CONF_TCP_CONNS */ /* UIP_CONF_ND6_SEND_RA enables standard IPv6 Router Advertisement. * We enable it by default when IPv6 is used without RPL. */ #ifndef UIP_CONF_ND6_SEND_RA -#define UIP_CONF_ND6_SEND_RA (NETSTACK_CONF_WITH_IPV6 && !UIP_CONF_IPV6_RPL) +#if (NETSTACK_CONF_WITH_IPV6 && !UIP_CONF_IPV6_RPL) +#define UIP_CONF_ND6_SEND_RA 1 +#else /* NETSTACK_CONF_WITH_IPV6 && !UIP_CONF_IPV6_RPL */ +#define UIP_CONF_ND6_SEND_RA 0 +#endif /* NETSTACK_CONF_WITH_IPV6 && !UIP_CONF_IPV6_RPL */ #endif /* UIP_CONF_ND6_SEND_RA */ /* UIP_CONF_ND6_SEND_NS enables standard IPv6 Neighbor Discovery Protocol @@ -127,7 +137,11 @@ timer) or if the neighbor chooses not to transmit DIOs because it is a leaf node or for any reason. */ #ifndef UIP_CONF_ND6_SEND_NS -#define UIP_CONF_ND6_SEND_NS (NETSTACK_CONF_WITH_IPV6 && !UIP_CONF_IPV6_RPL) +#if (NETSTACK_CONF_WITH_IPV6 && !UIP_CONF_IPV6_RPL) +#define UIP_CONF_ND6_SEND_NS 1 +#else /* (NETSTACK_CONF_WITH_IPV6 && !UIP_CONF_IPV6_RPL) */ +#define UIP_CONF_ND6_SEND_NS 0 +#endif /* (NETSTACK_CONF_WITH_IPV6 && !UIP_CONF_IPV6_RPL) */ #endif /* UIP_CONF_ND6_SEND_NS */ /* To speed up the neighbor cache construction, enable UIP_CONF_ND6_AUTOFILL_NBR_CACHE. When a node does not the link-layer @@ -138,13 +152,21 @@ standard-compliant (RFC 4861), as neighbors will be added regardless of their reachability and liveness. */ #ifndef UIP_CONF_ND6_AUTOFILL_NBR_CACHE -#define UIP_CONF_ND6_AUTOFILL_NBR_CACHE (!UIP_CONF_ND6_SEND_NS) +#if UIP_CONF_ND6_SEND_NS +#define UIP_CONF_ND6_AUTOFILL_NBR_CACHE 0 +#else /* UIP_CONF_ND6_SEND_NS */ +#define UIP_CONF_ND6_AUTOFILL_NBR_CACHE 1 +#endif /* UIP_CONF_ND6_SEND_NS */ #endif /* UIP_CONF_ND6_AUTOFILL_NBR_CACHE */ /* UIP_CONF_ND6_SEND_NA allows to still comply with NDP even if the host does not perform NUD or DAD processes. By default it is activated so the host can still communicate with a full NDP peer. */ #ifndef UIP_CONF_ND6_SEND_NA -#define UIP_CONF_ND6_SEND_NA (NETSTACK_CONF_WITH_IPV6) +#if NETSTACK_CONF_WITH_IPV6 +#define UIP_CONF_ND6_SEND_NA 1 +#else /* NETSTACK_CONF_WITH_IPV6 */ +#define UIP_CONF_ND6_SEND_NA 0 +#endif /* NETSTACK_CONF_WITH_IPV6 */ #endif /* UIP_CONF_ND6_SEND_NS */ /*---------------------------------------------------------------------------*/ diff --git a/os/net/ipv6/sicslowpan.c b/os/net/ipv6/sicslowpan.c index ee0cb2dfc..a115bd07b 100644 --- a/os/net/ipv6/sicslowpan.c +++ b/os/net/ipv6/sicslowpan.c @@ -64,6 +64,7 @@ #include "contiki.h" #include "dev/watchdog.h" #include "net/link-stats.h" +#include "net/ipv6/uipopt.h" #include "net/ipv6/tcpip.h" #include "net/ipv6/uip.h" #include "net/ipv6/uip-ds6.h" @@ -84,12 +85,6 @@ #define LOG_MODULE "6LoWPAN" #define LOG_LEVEL LOG_LEVEL_6LOWPAN -#ifdef SICSLOWPAN_CONF_COMPRESSION -#define SICSLOWPAN_COMPRESSION SICSLOWPAN_CONF_COMPRESSION -#else /* SICSLOWPAN_CONF_COMPRESSION */ -#define SICSLOWPAN_COMPRESSION SICSLOWPAN_COMPRESSION_IPHC -#endif /* SICSLOWPAN_CONF_COMPRESSION */ - #define GET16(ptr,index) (((uint16_t)((ptr)[index] << 8)) | ((ptr)[(index) + 1])) #define SET16(ptr,index,value) do { \ (ptr)[index] = ((value) >> 8) & 0xff; \ diff --git a/os/net/ipv6/uip-ds6-route.c b/os/net/ipv6/uip-ds6-route.c index e8327583a..9321b632c 100644 --- a/os/net/ipv6/uip-ds6-route.c +++ b/os/net/ipv6/uip-ds6-route.c @@ -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); diff --git a/os/net/ipv6/uip6.c b/os/net/ipv6/uip6.c index b39f72ffe..b0cab3ebd 100644 --- a/os/net/ipv6/uip6.c +++ b/os/net/ipv6/uip6.c @@ -1414,14 +1414,14 @@ uip_process(uint8_t flag) icmp6_input: /* This is IPv6 ICMPv6 processing code. */ - LOG_INFO("icmp6: input length %d type: %d \n", uip_len, UIP_ICMP_BUF->type); + LOG_INFO("icmpv6 input length %d type: %d \n", uip_len, UIP_ICMP_BUF->type); #if UIP_CONF_IPV6_CHECKS /* Compute and check the ICMP header checksum */ if(uip_icmp6chksum() != 0xffff) { UIP_STAT(++uip_stat.icmp.drop); UIP_STAT(++uip_stat.icmp.chkerr); - LOG_ERR("icmpv6: bad checksum\n"); + LOG_ERR("icmpv6 bad checksum\n"); goto drop; } #endif /*UIP_CONF_IPV6_CHECKS*/ diff --git a/os/net/ipv6/uipopt.h b/os/net/ipv6/uipopt.h index 5a401b123..84b7fd023 100644 --- a/os/net/ipv6/uipopt.h +++ b/os/net/ipv6/uipopt.h @@ -540,8 +540,10 @@ void uip_log(char *msg); * Do we compress the IP header or not */ #ifndef SICSLOWPAN_CONF_COMPRESSION -#define SICSLOWPAN_CONF_COMPRESSION SICSLOWPAN_COMPRESSION_HC06 -#endif +#define SICSLOWPAN_COMPRESSION SICSLOWPAN_COMPRESSION_IPHC +#else +#define SICSLOWPAN_COMPRESSION SICSLOWPAN_CONF_COMPRESSION +#endif /* SICSLOWPAN_CONF_COMPRESSION */ /** * If we use IPHC compression, how many address contexts do we support diff --git a/os/net/mac/framer/frame802154.h b/os/net/mac/framer/frame802154.h index 24a8c632c..4c3c2f967 100644 --- a/os/net/mac/framer/frame802154.h +++ b/os/net/mac/framer/frame802154.h @@ -77,7 +77,13 @@ #ifdef FRAME802154_CONF_VERSION #define FRAME802154_VERSION FRAME802154_CONF_VERSION #else /* FRAME802154_CONF_VERSION */ +/* Use frame v2 if TSCH is used, otherwise stick to v1 (more +frame-filtering-friendly on some platforms) */ +#if MAC_CONF_WITH_TSCH #define FRAME802154_VERSION FRAME802154_IEEE802154_2015 +#else /* MAC_CONF_WITH_TSCH */ +#define FRAME802154_VERSION FRAME802154_IEEE802154_2006 +#endif /* MAC_CONF_WITH_TSCH */ #endif /* FRAME802154_CONF_VERSION */ #ifdef FRAME802154_CONF_SUPPR_SEQNO diff --git a/os/net/mac/framer/framer-802154.c b/os/net/mac/framer/framer-802154.c index bcc1bf153..7122c5ccd 100644 --- a/os/net/mac/framer/framer-802154.c +++ b/os/net/mac/framer/framer-802154.c @@ -118,7 +118,7 @@ create_frame(int do_create) return hdr_len; } else { - LOG_ERR("15.4-OUT: too large header: %u\n", hdr_len); + LOG_ERR("Out: too large header: %u\n", hdr_len); return FRAMER_FAILED; } } @@ -278,7 +278,7 @@ parse(void) } #endif /* LLSEC802154_USES_AUX_HEADER */ - LOG_INFO("15.4-IN: %2X ", frame.fcf.frame_type); + LOG_INFO("In: %2X ", frame.fcf.frame_type); LOG_INFO_LLADDR(packetbuf_addr(PACKETBUF_ADDR_SENDER)); LOG_INFO_(" "); LOG_INFO_LLADDR(packetbuf_addr(PACKETBUF_ADDR_RECEIVER)); diff --git a/os/net/mac/tsch/tsch-conf.h b/os/net/mac/tsch/tsch-conf.h index f7657f7d6..2934738b8 100644 --- a/os/net/mac/tsch/tsch-conf.h +++ b/os/net/mac/tsch/tsch-conf.h @@ -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? */ diff --git a/os/net/mac/tsch/tsch-log.h b/os/net/mac/tsch/tsch-log.h index f73e0ddc4..06888e24f 100644 --- a/os/net/mac/tsch/tsch-log.h +++ b/os/net/mac/tsch/tsch-log.h @@ -51,7 +51,7 @@ #define TSCH_LOG_PER_SLOT TSCH_LOG_CONF_PER_SLOT #else /* TSCH_LOG_CONF_PER_SLOT */ #include "sys/log.h" -#define TSCH_LOG_PER_SLOT (LOG_LEVEL_MAC >= LOG_LEVEL_DBG) +#define TSCH_LOG_PER_SLOT (LOG_CONF_LEVEL_MAC >= LOG_LEVEL_DBG) #endif /* TSCH_LOG_CONF_PER_SLOT */ /* The length of the log queue, i.e. maximum number postponed log messages */ diff --git a/os/net/mac/tsch/tsch-queue.h b/os/net/mac/tsch/tsch-queue.h index fad8630c1..037461e7d 100644 --- a/os/net/mac/tsch/tsch-queue.h +++ b/os/net/mac/tsch/tsch-queue.h @@ -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; diff --git a/os/net/mac/tsch/tsch-schedule.h b/os/net/mac/tsch/tsch-schedule.h index 206b40aab..12699b0e3 100644 --- a/os/net/mac/tsch/tsch-schedule.h +++ b/os/net/mac/tsch/tsch-schedule.h @@ -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 */ diff --git a/os/net/mac/tsch/tsch.c b/os/net/mac/tsch/tsch.c index ba57c981e..cedc9c316 100644 --- a/os/net/mac/tsch/tsch.c +++ b/os/net/mac/tsch/tsch.c @@ -185,6 +185,9 @@ static void packet_input(void); void tsch_set_coordinator(int enable) { + if(tsch_is_coordinator != enable) { + tsch_is_associated = 0; + } tsch_is_coordinator = enable; tsch_set_eb_period(TSCH_EB_PERIOD); } diff --git a/os/net/mac/tsch/tsch.h b/os/net/mac/tsch/tsch.h index c93d2d460..9d7661cf8 100644 --- a/os/net/mac/tsch/tsch.h +++ b/os/net/mac/tsch/tsch.h @@ -84,7 +84,7 @@ frequency hopping for enhanced reliability. #ifdef TSCH_CONF_MAX_EB_PERIOD #define TSCH_MAX_EB_PERIOD TSCH_CONF_MAX_EB_PERIOD #else -#define TSCH_MAX_EB_PERIOD (50 * CLOCK_SECOND) +#define TSCH_MAX_EB_PERIOD (16 * CLOCK_SECOND) #endif /* Max acceptable join priority */ @@ -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(); diff --git a/os/net/rpl-classic/rpl-ext-header.c b/os/net/rpl-classic/rpl-ext-header.c index aa0260aae..0c1f8076a 100644 --- a/os/net/rpl-classic/rpl-ext-header.c +++ b/os/net/rpl-classic/rpl-ext-header.c @@ -410,7 +410,7 @@ insert_srh_header(void) /* Check if there is enough space to store the extension header */ if(uip_len + ext_len > UIP_BUFSIZE) { PRINTF("RPL: Packet too long: impossible to add source routing header (%u bytes)\n", ext_len); - return 1; + return 0; } /* Move existing ext headers and payload uip_ext_len further */ diff --git a/os/net/rpl-classic/rpl-private.h b/os/net/rpl-classic/rpl-private.h index 73de3104c..f00734821 100644 --- a/os/net/rpl-classic/rpl-private.h +++ b/os/net/rpl-classic/rpl-private.h @@ -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. */ diff --git a/os/net/rpl-lite/rpl-conf.h b/os/net/rpl-lite/rpl-conf.h index ed69b86d6..6ada97f0b 100644 --- a/os/net/rpl-lite/rpl-conf.h +++ b/os/net/rpl-lite/rpl-conf.h @@ -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 */ diff --git a/os/net/rpl-lite/rpl-ext-header.c b/os/net/rpl-lite/rpl-ext-header.c index 878797c8b..e71e6c1f6 100644 --- a/os/net/rpl-lite/rpl-ext-header.c +++ b/os/net/rpl-lite/rpl-ext-header.c @@ -241,14 +241,16 @@ insert_srh_header(void) /* Get link of the destination and root */ if(!rpl_is_addr_in_our_dag(&UIP_IP_BUF->destipaddr)) { - LOG_ERR("SRH destination not in our DAG\n"); - return 0; + /* The destination is not in our DAG, skip SRH insertion */ + LOG_INFO("SRH destination not in our DAG, skip SRH insertion\n"); + return 1; } dest_node = rpl_ns_get_node(&UIP_IP_BUF->destipaddr); if(dest_node == NULL) { - LOG_ERR("SRH node not found\n"); - return 0; + /* The destination is not found, skip SRH insertion */ + LOG_INFO("SRH node not found, skip SRH insertion\n"); + return 1; } root_node = rpl_ns_get_node(&curr_instance.dag.dag_id); @@ -302,7 +304,7 @@ insert_srh_header(void) /* Check if there is enough space to store the extension header */ if(uip_len + ext_len > UIP_BUFSIZE) { LOG_ERR("packet too long: impossible to add source routing header (%u bytes)\n", ext_len); - return 1; + return 0; } /* Move existing ext headers and payload uip_ext_len further */ @@ -507,20 +509,10 @@ rpl_ext_header_update(void) if(rpl_dag_root_is_root()) { /* At the root, remove headers if any, and insert SRH or HBH - * (SRH is inserted only if the destination is in the DODAG) */ + * (SRH is inserted only if the destination is down the DODAG) */ rpl_ext_header_remove(); - if(rpl_is_addr_in_our_dag(&UIP_IP_BUF->destipaddr)) { - /* dest is in a DODAG; the packet is going down. */ - if(curr_instance.mop != RPL_MOP_NO_DOWNWARD_ROUTES) { - return insert_srh_header(); - } else { - LOG_ERR("packet going down at root, but no support for downward routing\n"); - return 0; /* No support for downward routes */ - } - } else { - /* dest is outside of DODAGs; no ext header is needed. */ - return 1; - } + /* Insert SRH (if needed) */ + return insert_srh_header(); } else { if(uip_ds6_is_my_addr(&UIP_IP_BUF->srcipaddr) && UIP_IP_BUF->ttl == uip_ds6_if.cur_hop_limit) { diff --git a/os/services/orchestra/Makefile.orchestra b/os/services/orchestra/Makefile.orchestra new file mode 100644 index 000000000..0cdff2688 --- /dev/null +++ b/os/services/orchestra/Makefile.orchestra @@ -0,0 +1 @@ +CFLAGS += -DBUILD_WITH_ORCHESTRA=1 diff --git a/os/services/orchestra/orchestra-conf.h b/os/services/orchestra/orchestra-conf.h index d8116ff16..a23b31f9b 100644 --- a/os/services/orchestra/orchestra-conf.h +++ b/os/services/orchestra/orchestra-conf.h @@ -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 } */ diff --git a/os/services/shell/Makefile.shell b/os/services/shell/Makefile.shell new file mode 100644 index 000000000..9b9549018 --- /dev/null +++ b/os/services/shell/Makefile.shell @@ -0,0 +1 @@ +CFLAGS += -DBUILD_WITH_SHELL=1 diff --git a/os/services/shell/shell-commands.c b/os/services/shell/shell-commands.c index 4e6d91f0d..7c14e1ef5 100644 --- a/os/services/shell/shell-commands.c +++ b/os/services/shell/shell-commands.c @@ -51,17 +51,20 @@ #include "net/ipv6/uiplib.h" #include "net/ipv6/uip-icmp6.h" #include "net/ipv6/uip-ds6.h" +#if MAC_CONF_WITH_TSCH #include "net/mac/tsch/tsch.h" #include "net/mac/tsch/tsch-adaptive-timesync.h" #include "net/mac/tsch/tsch-queue.h" #include "net/mac/tsch/tsch-log.h" #include "net/mac/tsch/tsch-private.h" -#if UIP_CONF_IPV6_RPL_LITE == 1 +#endif /* MAC_CONF_WITH_TSCH */ +#if UIP_CONF_IPV6_RPL_LITE #include "net/rpl-lite/rpl.h" -#else /* UIP_CONF_IPV6_RPL_LITE == 1 */ +#elif UIP_CONF_IPV6_RPL_CLASSIC #include "net/rpl-classic/rpl.h" #include "net/rpl-classic/rpl-private.h" -#endif /* UIP_CONF_IPV6_RPL_LITE == 1 */ +#endif +#include "net/mac/llsec802154.h" #include @@ -95,6 +98,7 @@ ds6_nbr_state_to_str(uint8_t state) return "Unknown"; } } +#if UIP_CONF_IPV6_RPL_LITE /*---------------------------------------------------------------------------*/ static const char * rpl_state_to_str(enum rpl_dag_state state) @@ -142,6 +146,7 @@ rpl_ocp_to_str(int ocp) return "Unknown"; } } +#endif /* UIP_CONF_IPV6_RPL_LITE */ /*---------------------------------------------------------------------------*/ static void echo_reply_handler(uip_ipaddr_t *source, uint8_t ttl, uint8_t *data, uint16_t datalen) @@ -196,70 +201,15 @@ PT_THREAD(cmd_ping(struct pt *pt, shell_output_func output, char *args)) PT_END(pt); } /*---------------------------------------------------------------------------*/ -static -PT_THREAD(cmd_rpl_set_root(struct pt *pt, shell_output_func output, char *args)) -{ - static int is_on; - static uip_ipaddr_t prefix; - char *next_args; - - PT_BEGIN(pt); - - SHELL_ARGS_INIT(args, next_args); - - /* Get first arg (0/1) */ - SHELL_ARGS_NEXT(args, next_args); - - if(!strcmp(args, "1")) { - is_on = 1; - } else if(!strcmp(args, "0")) { - is_on = 0; - } else { - SHELL_OUTPUT(output, "Invalid argument: %s\n", args); - PT_EXIT(pt); - } - - /* Get first second arg (prefix) */ - SHELL_ARGS_NEXT(args, next_args); - if(args != NULL) { - if(uiplib_ipaddrconv(args, &prefix) == 0) { - SHELL_OUTPUT(output, "Invalid Prefix: %s\n", args); - PT_EXIT(pt); - } - } else { - uip_ip6addr(&prefix, UIP_DS6_DEFAULT_PREFIX, 0, 0, 0, 0, 0, 0, 0); - } - - if(is_on) { - if(!rpl_dag_root_is_root()) { - SHELL_OUTPUT(output, "Setting as DAG root with prefix "); - shell_output_6addr(output, &prefix); - SHELL_OUTPUT(output, "\n"); - rpl_dag_root_init(&prefix, NULL); - rpl_dag_root_init_dag_immediately(); - } else { - SHELL_OUTPUT(output, "Node is already a DAG root\n"); - } - } else { - if(rpl_dag_root_is_root()) { - SHELL_OUTPUT(output, "Setting as non-root node: leaving DAG\n"); - rpl_dag_poison_and_leave(); - } else { - SHELL_OUTPUT(output, "Node is not a DAG root\n"); - } - } - - PT_END(pt); -} -/*---------------------------------------------------------------------------*/ static void shell_output_log_levels(shell_output_func output) { int i = 0; SHELL_OUTPUT(output, "Log levels:\n"); while(all_modules[i].name != NULL) { - SHELL_OUTPUT(output, "-- %-10s: %s\n", + SHELL_OUTPUT(output, "-- %-10s: %u (%s)\n", all_modules[i].name, + *all_modules[i].curr_log_level, log_level_to_str(*all_modules[i].curr_log_level)); i++; } @@ -304,6 +254,7 @@ PT_THREAD(cmd_log(struct pt *pt, shell_output_func output, char *args)) /* Set log level */ if(level != prev_level) { log_set_level(module, level); +#if MAC_CONF_WITH_TSCH && TSCH_LOG_PER_SLOT if(!strcmp(module, "mac") || !strcmp(module, "all")) { if(level >= LOG_LEVEL_DBG) { tsch_log_init(); @@ -313,6 +264,7 @@ PT_THREAD(cmd_log(struct pt *pt, shell_output_func output, char *args)) SHELL_OUTPUT(output, "TSCH logging stopped\n"); } } +#endif /* MAC_CONF_WITH_TSCH && TSCH_LOG_PER_SLOT */ } shell_output_log_levels(output); @@ -336,6 +288,107 @@ PT_THREAD(cmd_help(struct pt *pt, shell_output_func output, char *args)) PT_END(pt); } +#if UIP_CONF_IPV6_RPL_LITE +/*---------------------------------------------------------------------------*/ +static +PT_THREAD(cmd_rpl_set_root(struct pt *pt, shell_output_func output, char *args)) +{ + static int is_on; + static uip_ipaddr_t prefix; + char *next_args; + + PT_BEGIN(pt); + + SHELL_ARGS_INIT(args, next_args); + + /* Get first arg (0/1) */ + SHELL_ARGS_NEXT(args, next_args); + + if(!strcmp(args, "1")) { + is_on = 1; + } else if(!strcmp(args, "0")) { + is_on = 0; + } else { + SHELL_OUTPUT(output, "Invalid argument: %s\n", args); + PT_EXIT(pt); + } + + /* Get first second arg (prefix) */ + SHELL_ARGS_NEXT(args, next_args); + if(args != NULL) { + if(uiplib_ipaddrconv(args, &prefix) == 0) { + SHELL_OUTPUT(output, "Invalid Prefix: %s\n", args); + PT_EXIT(pt); + } + } else { + uip_ip6addr(&prefix, UIP_DS6_DEFAULT_PREFIX, 0, 0, 0, 0, 0, 0, 0); + } + + if(is_on) { + if(!rpl_dag_root_is_root()) { + SHELL_OUTPUT(output, "Setting as DAG root with prefix "); + shell_output_6addr(output, &prefix); + SHELL_OUTPUT(output, "/64\n"); + rpl_dag_root_init(&prefix, NULL); + rpl_dag_root_init_dag_immediately(); + } else { + SHELL_OUTPUT(output, "Node is already a DAG root\n"); + } + } else { + if(rpl_dag_root_is_root()) { + SHELL_OUTPUT(output, "Setting as non-root node: leaving DAG\n"); + rpl_dag_poison_and_leave(); + } else { + SHELL_OUTPUT(output, "Node is not a DAG root\n"); + } + } + + PT_END(pt); +} +/*---------------------------------------------------------------------------*/ +static +PT_THREAD(cmd_rpl_status(struct pt *pt, shell_output_func output, char *args)) +{ + PT_BEGIN(pt); + + SHELL_OUTPUT(output, "RPL status:\n"); + if(!curr_instance.used) { + SHELL_OUTPUT(output, "-- Instance: None\n"); + } else { + SHELL_OUTPUT(output, "-- Instance: %u\n", curr_instance.instance_id); + if(rpl_dag_root_is_root()) { + SHELL_OUTPUT(output, "-- DAG root\n"); + } else { + SHELL_OUTPUT(output, "-- DAG node\n"); + } + SHELL_OUTPUT(output, "-- DAG: "); + shell_output_6addr(output, &curr_instance.dag.dag_id); + SHELL_OUTPUT(output, ", version %u\n", curr_instance.dag.version); + SHELL_OUTPUT(output, "-- Prefix: "); + shell_output_6addr(output, &curr_instance.dag.prefix_info.prefix); + SHELL_OUTPUT(output, "/%u\n", curr_instance.dag.prefix_info.length); + SHELL_OUTPUT(output, "-- MOP: %s\n", rpl_mop_to_str(curr_instance.mop)); + SHELL_OUTPUT(output, "-- OF: %s\n", rpl_ocp_to_str(curr_instance.of->ocp)); + SHELL_OUTPUT(output, "-- Hop rank increment: %u\n", curr_instance.min_hoprankinc); + SHELL_OUTPUT(output, "-- Default lifetime: %lu seconds\n", RPL_LIFETIME(curr_instance.default_lifetime)); + + SHELL_OUTPUT(output, "-- State: %s\n", rpl_state_to_str(curr_instance.dag.state)); + SHELL_OUTPUT(output, "-- Preferred parent: "); + shell_output_6addr(output, rpl_neighbor_get_ipaddr(curr_instance.dag.preferred_parent)); + SHELL_OUTPUT(output, "\n"); + SHELL_OUTPUT(output, "-- Rank: %u\n", curr_instance.dag.rank); + SHELL_OUTPUT(output, "-- Lowest rank: %u (%u)\n", curr_instance.dag.lowest_rank, curr_instance.max_rankinc); + SHELL_OUTPUT(output, "-- DTSN out: %u\n", curr_instance.dtsn_out); + SHELL_OUTPUT(output, "-- DAO sequence: last sent %u, last acked %u\n", + curr_instance.dag.dao_last_seqno, curr_instance.dag.dao_last_acked_seqno); + SHELL_OUTPUT(output, "-- Trickle timer: current %u, min %u, max %u, redundancy %u\n", + curr_instance.dag.dio_intcurrent, curr_instance.dio_intmin, + curr_instance.dio_intmin + curr_instance.dio_intdoubl, curr_instance.dio_redundancy); + + } + + PT_END(pt); +} /*---------------------------------------------------------------------------*/ static PT_THREAD(cmd_rpl_global_repair(struct pt *pt, shell_output_func output, char *args)) @@ -358,6 +411,7 @@ PT_THREAD(cmd_rpl_local_repair(struct pt *pt, shell_output_func output, char *ar PT_END(pt); } +#endif /* UIP_CONF_IPV6_RPL_LITE */ /*---------------------------------------------------------------------------*/ static PT_THREAD(cmd_ipaddr(struct pt *pt, shell_output_func output, char *args)) @@ -410,6 +464,59 @@ PT_THREAD(cmd_ip_neighbors(struct pt *pt, shell_output_func output, char *args)) PT_END(pt); } +#if MAC_CONF_WITH_TSCH +/*---------------------------------------------------------------------------*/ +static +PT_THREAD(cmd_tsch_set_coordinator(struct pt *pt, shell_output_func output, char *args)) +{ + static int is_on; + static int is_secured; + char *next_args; + + PT_BEGIN(pt); + + SHELL_ARGS_INIT(args, next_args); + + /* Get first arg (0/1) */ + SHELL_ARGS_NEXT(args, next_args); + + if(!strcmp(args, "1")) { + is_on = 1; + } else if(!strcmp(args, "0")) { + is_on = 0; + } else { + SHELL_OUTPUT(output, "Invalid first argument: %s\n", args); + PT_EXIT(pt); + } + + /* Get first second arg (prefix) */ + SHELL_ARGS_NEXT(args, next_args); + if(args != NULL) { + if(!strcmp(args, "1")) { +#if LLSEC802154_ENABLED + is_secured = 1; +#else /* LLSEC802154_ENABLED */ + SHELL_OUTPUT(output, "Security is not compiled in.\n"); + is_secured = 0; +#endif /* LLSEC802154_ENABLED */ + } else if(!strcmp(args, "0")) { + is_secured = 0; + } else { + SHELL_OUTPUT(output, "Invalid second argument: %s\n", args); + PT_EXIT(pt); + } + } else { + is_secured = 0; + } + + SHELL_OUTPUT(output, "Setting as TSCH %s (%s)\n", + is_on ? "coordinator" : "non-coordinator", is_secured ? "secured" : "non-secured"); + + tsch_set_pan_secured(is_secured); + tsch_set_coordinator(is_on); + + PT_END(pt); +} /*---------------------------------------------------------------------------*/ static PT_THREAD(cmd_tsch_status(struct pt *pt, shell_output_func output, char *args)) @@ -438,50 +545,7 @@ PT_THREAD(cmd_tsch_status(struct pt *pt, shell_output_func output, char *args)) PT_END(pt); } -/*---------------------------------------------------------------------------*/ -static -PT_THREAD(cmd_rpl_status(struct pt *pt, shell_output_func output, char *args)) -{ - PT_BEGIN(pt); - - SHELL_OUTPUT(output, "RPL status:\n"); - if(!curr_instance.used) { - SHELL_OUTPUT(output, "-- Instance: None\n"); - } else { - SHELL_OUTPUT(output, "-- Instance: %u\n", curr_instance.instance_id); - if(rpl_dag_root_is_root()) { - SHELL_OUTPUT(output, "-- DAG root\n"); - } else { - SHELL_OUTPUT(output, "-- DAG node\n"); - } - SHELL_OUTPUT(output, "-- DAG: "); - shell_output_6addr(output, &curr_instance.dag.dag_id); - SHELL_OUTPUT(output, ", version %u\n", curr_instance.dag.version); - SHELL_OUTPUT(output, "-- Prefix: "); - shell_output_6addr(output, &curr_instance.dag.prefix_info.prefix); - SHELL_OUTPUT(output, "/%u\n", curr_instance.dag.prefix_info.length); - SHELL_OUTPUT(output, "-- MOP: %s\n", rpl_mop_to_str(curr_instance.mop)); - SHELL_OUTPUT(output, "-- OF: %s\n", rpl_ocp_to_str(curr_instance.of->ocp)); - SHELL_OUTPUT(output, "-- Hop rank increment: %u\n", curr_instance.min_hoprankinc); - SHELL_OUTPUT(output, "-- Default lifetime: %lu seconds\n", RPL_LIFETIME(curr_instance.default_lifetime)); - - SHELL_OUTPUT(output, "-- State: %s\n", rpl_state_to_str(curr_instance.dag.state)); - SHELL_OUTPUT(output, "-- Preferred parent: "); - shell_output_6addr(output, rpl_neighbor_get_ipaddr(curr_instance.dag.preferred_parent)); - SHELL_OUTPUT(output, "\n"); - SHELL_OUTPUT(output, "-- Rank: %u\n", curr_instance.dag.rank); - SHELL_OUTPUT(output, "-- Lowest rank: %u (%u)\n", curr_instance.dag.lowest_rank, curr_instance.max_rankinc); - SHELL_OUTPUT(output, "-- DTSN out: %u\n", curr_instance.dtsn_out); - SHELL_OUTPUT(output, "-- DAO sequence: last sent %u, last acked %u\n", - curr_instance.dag.dao_last_seqno, curr_instance.dag.dao_last_acked_seqno); - SHELL_OUTPUT(output, "-- Trickle timer: current %u, min %u, max %u, redundancy %u\n", - curr_instance.dag.dio_intcurrent, curr_instance.dio_intmin, - curr_instance.dio_intmin + curr_instance.dio_intdoubl, curr_instance.dio_redundancy); - - } - - PT_END(pt); -} +#endif /* MAC_CONF_WITH_TSCH */ /*---------------------------------------------------------------------------*/ static PT_THREAD(cmd_routes(struct pt *pt, shell_output_func output, char *args)) @@ -575,6 +639,8 @@ PT_THREAD(cmd_reboot(struct pt *pt, shell_output_func output, char *args)) watchdog_reboot(); PT_END(pt); } +#if MAC_CONF_WITH_TSCH +/*---------------------------------------------------------------------------*/ static PT_THREAD(cmd_tsch_schedule(struct pt *pt, shell_output_func output, char *args)) { @@ -610,6 +676,7 @@ PT_THREAD(cmd_tsch_schedule(struct pt *pt, shell_output_func output, char *args) } PT_END(pt); } +#endif /* MAC_CONF_WITH_TSCH */ /*---------------------------------------------------------------------------*/ #if TSCH_WITH_SIXTOP void @@ -645,22 +712,32 @@ shell_commands_init(void) /* Set up Ping Reply callback */ uip_icmp6_echo_reply_callback_add(&echo_reply_notification, echo_reply_handler); + /* Start with soft log level 0 so as to minimize interference with shell */ + log_set_level("all", LOG_LEVEL_NONE); +#if MAC_CONF_WITH_TSCH && TSCH_LOG_PER_SLOT + tsch_log_stop(); +#endif /* MAC_CONF_WITH_TSCH && TSCH_LOG_PER_SLOT */ } /*---------------------------------------------------------------------------*/ struct shell_command_t shell_commands[] = { { "help", cmd_help, "'> help': Shows this help" }, + { "reboot", cmd_reboot, "'> reboot': Reboot the board by watchdog_reboot()" }, { "ip-addr", cmd_ipaddr, "'> ip-addr': Shows all IPv6 addresses" }, { "ip-nbr", cmd_ip_neighbors, "'> ip-nbr': Shows all IPv6 neighbors" }, { "log", cmd_log, "'> log module level': Sets log level (0--4) for a given module (or \"all\"). For module \"mac\", level 4 also enables per-slot logging." }, { "ping", cmd_ping, "'> ping addr': Pings the IPv6 address 'addr'" }, - { "rpl-set-root", cmd_rpl_set_root, "'> rpl-set-root 0/1 [prefix]': Sets node as root (on) or not (off). A /64 prefix can be optionally specified." }, +#if UIP_CONF_IPV6_RPL_LITE + { "rpl-set-root", cmd_rpl_set_root, "'> rpl-set-root 0/1 [prefix]': Sets node as root (1) or not (0). A /64 prefix can be optionally specified." }, { "rpl-status", cmd_rpl_status, "'> rpl-status': Shows a summary of the current RPL state" }, - { "rpl-global-repair", cmd_rpl_global_repair, "'> rpl-global-repair': Triggers a RPL global repair" }, { "rpl-local-repair", cmd_rpl_local_repair, "'> rpl-local-repair': Triggers a RPL local repair" }, + { "rpl-global-repair", cmd_rpl_global_repair, "'> rpl-global-repair': Triggers a RPL global repair" }, +#endif /* UIP_CONF_IPV6_RPL_LITE */ { "routes", cmd_routes, "'> routes': Shows the route entries" }, +#if MAC_CONF_WITH_TSCH + { "tsch-set-coordinator", cmd_tsch_set_coordinator, "'> tsch-set-coordinator 0/1 [0/1]': Sets node as coordinator (1) or not (0). Second, optional parameter: enable (1) or disable (0) security." }, { "tsch-schedule", cmd_tsch_schedule, "'> tsch-schedule': Shows the current TSCH schedule" }, { "tsch-status", cmd_tsch_status, "'> tsch-status': Shows a summary of the current TSCH state" }, - { "reboot", cmd_reboot, "'> reboot': Reboot the board by watchdog_reboot()" }, +#endif /* MAC_CONF_WITH_TSCH */ #if TSCH_WITH_SIXTOP { "6top", cmd_6top, "'> 6top help': Shows 6top command usage" }, #endif /* TSCH_WITH_SIXTOP */ diff --git a/os/services/shell/shell.c b/os/services/shell/shell.c index f10852414..1e344dc1a 100644 --- a/os/services/shell/shell.c +++ b/os/services/shell/shell.c @@ -106,6 +106,7 @@ shell_output_lladdr(shell_output_func output, const linkaddr_t *lladdr) static void output_prompt(shell_output_func output) { + SHELL_OUTPUT(output, "#"); shell_output_lladdr(output, &linkaddr_node_addr); SHELL_OUTPUT(output, "> "); } diff --git a/os/sys/log-conf.h b/os/sys/log-conf.h index d38659386..1c992c2fa 100644 --- a/os/sys/log-conf.h +++ b/os/sys/log-conf.h @@ -95,7 +95,7 @@ #endif /* LOG_CONF_LEVEL_6LOWPAN */ #ifndef LOG_CONF_LEVEL_NULLNET -#define LOG_CONF_LEVEL_NULLNET LOG_LEVEL_INFO +#define LOG_CONF_LEVEL_NULLNET LOG_LEVEL_NONE #endif /* LOG_CONF_LEVEL_NULLNET */ #ifndef LOG_CONF_LEVEL_MAC diff --git a/tests/13-ieee802154/code-flush-nbr-queue/project-conf.h b/tests/13-ieee802154/code-flush-nbr-queue/project-conf.h index 52b95b95c..6923ae6fb 100644 --- a/tests/13-ieee802154/code-flush-nbr-queue/project-conf.h +++ b/tests/13-ieee802154/code-flush-nbr-queue/project-conf.h @@ -37,15 +37,8 @@ /* Set the minimum value of QUEUEBUF_CONF_NUM for the flush_nbr_queue test */ #define QUEUEBUF_CONF_NUM 1 -/* TSCH per-slot logging */ -#define TSCH_LOG_CONF_PER_SLOT 1 - #define TSCH_CONF_AUTOSTART 1 #define TSCH_CONF_WITH_SIXTOP 1 -#if CONTIKI_TARGET_COOJA -#define COOJA_CONF_SIMULATE_TURNAROUND 0 -#endif /* CONTIKI_TARGET_COOJA */ - #endif /* __PROJECT_CONF_H__ */ diff --git a/tests/15-rpl-classic/code/Makefile b/tests/15-rpl-classic/code/Makefile index 329dcc0d9..40155b343 100644 --- a/tests/15-rpl-classic/code/Makefile +++ b/tests/15-rpl-classic/code/Makefile @@ -1,5 +1,5 @@ all: sender-node receiver-node root-node CONTIKI=../../.. -CONTIKI_WITH_RPL_LITE = 0 +MAKE_ROUTING = MAKE_ROUTING_RPL_CLASSIC include $(CONTIKI)/Makefile.include diff --git a/tests/16-6tisch/code/project-conf.h b/tests/16-6tisch/code/project-conf.h index 3cd35f11d..657244d5a 100644 --- a/tests/16-6tisch/code/project-conf.h +++ b/tests/16-6tisch/code/project-conf.h @@ -31,12 +31,6 @@ #ifndef _PROJECT_CONF_H_ #define _PROJECT_CONF_H_ -#if CONTIKI_TARGET_COOJA -#define COOJA_CONF_SIMULATE_TURNAROUND 0 -#else -//#error "This file is intended to be used for Cooja mote." -#endif /* CONTIKI_TARGET_COOJA */ - #define SIXTOP_CONF_MAX_SCHEDULING_FUNCTIONS 2 #define SIXTOP_CONF_MAX_TRANSACTIONS 2 @@ -49,8 +43,6 @@ #define TSCH_CONF_WITH_SIXTOP 1 -#define TSCH_LOG_CONF_PER_SLOT 1 - #define LOG_CONF_LEVEL_6TOP LOG_LEVEL_DBG #define TSCH_CONF_AUTOSTART 0 diff --git a/tools/viewconf.c b/tools/viewconf.c index 1dc6db395..9f1e441ae 100644 --- a/tools/viewconf.c +++ b/tools/viewconf.c @@ -1,29 +1,47 @@ #include "contiki.h" +#include "os/net/mac/framer/frame802154.h" +#include "os/net/mac/tsch/tsch.h" +#include "os/net/mac/tsch/tsch-conf.h" +#include "os/net/mac/tsch/tsch-schedule.h" +#include "os/net/ipv6/uip-nd6.h" +#include "os/net/ipv6/uipopt.h" +#include "os/net/queuebuf.h" +#include "os/net/nbr-table.h" +#include "os/sys/log-conf.h" ##### "PROJECT_CONF_PATH": _____________________ PROJECT_CONF_PATH -##### "MAC_CONF_WITH_NULLMAC": _________________ MAC_CONF_WITH_NULLMAC -##### "MAC_CONF_WITH_CSMA": ____________________ MAC_CONF_WITH_CSMA -##### "MAC_CONF_WITH_TSCH": ____________________ MAC_CONF_WITH_TSCH -##### "MAC_CONF_WITH_OTHER": ___________________ MAC_CONF_WITH_OTHER -##### "NETSTACK_CONF_WITH_NULLNET": ____________ NETSTACK_CONF_WITH_NULLNET -##### "NETSTACK_CONF_WITH_IPV6": _______________ NETSTACK_CONF_WITH_IPV6 -##### "NETSTACK_CONF_WITH_OTHER": ______________ NETSTACK_CONF_WITH_OTHER ##### "CONTIKI_VERSION_STRING": ________________ CONTIKI_VERSION_STRING -##### "AUTOSTART_ENABLE": ______________________ AUTOSTART_ENABLE -##### "QUEUEBUF_CONF_NUM": _____________________ QUEUEBUF_CONF_NUM -##### "NBR_TABLE_CONF_MAX_NEIGHBORS": __________ NBR_TABLE_CONF_MAX_NEIGHBORS +##### "IEEE802154_PANID":_______________________ IEEE802154_PANID +##### "FRAME802154_VERSION":____________________ FRAME802154_VERSION +#if MAC_CONF_WITH_TSCH +##### "TSCH_DEFAULT_HOPPING_SEQUENCE": _________ TSCH_DEFAULT_HOPPING_SEQUENCE +##### "TSCH_JOIN_HOPPING_SEQUENCE": ____________ TSCH_JOIN_HOPPING_SEQUENCE +##### "TSCH_EB_PERIOD": ________________________ TSCH_EB_PERIOD +##### "TSCH_MAX_EB_PERIOD": ____________________ TSCH_MAX_EB_PERIOD +##### "TSCH_CONF_DEFAULT_TIMESLOT_LENGTH": _____ TSCH_CONF_DEFAULT_TIMESLOT_LENGTH +##### "TSCH_SCHEDULE_DEFAULT_LENGTH": __________ TSCH_SCHEDULE_DEFAULT_LENGTH +#else /* MAC_CONF_WITH_TSCH */ +##### "RF_CHANNEL": ____________________________ RF_CHANNEL +#endif /*MAC_CONF_WITH_TSCH */ +##### "QUEUEBUF_NUM": __________________________ QUEUEBUF_CONF_NUM +##### "NBR_TABLE_MAX_NEIGHBORS": _______________ NBR_TABLE_CONF_MAX_NEIGHBORS ##### "NETSTACK_MAX_ROUTE_ENTRIES": ____________ NETSTACK_MAX_ROUTE_ENTRIES ##### "UIP_CONF_BUFFER_SIZE": __________________ UIP_CONF_BUFFER_SIZE -##### "UIP_CONF_ROUTER": _______________________ UIP_CONF_ROUTER -##### "NBR_TABLE_FIND_REMOVABLE": ______________ NBR_TABLE_FIND_REMOVABLE ##### "UIP_CONF_UDP": __________________________ UIP_CONF_UDP -##### "UIP_CONF_UDP_CONNS": ____________________ UIP_CONF_UDP_CONNS +##### "UIP_UDP_CONNS": _________________________ UIP_UDP_CONNS ##### "UIP_CONF_TCP": __________________________ UIP_CONF_TCP -##### "UIP_CONF_TCP_CONNS": ____________________ UIP_CONF_TCP_CONNS -##### "UIP_CONF_ND6_SEND_RA": __________________ UIP_CONF_ND6_SEND_RA -##### "UIP_CONF_ND6_SEND_NS": __________________ UIP_CONF_ND6_SEND_NS -##### "UIP_CONF_ND6_AUTOFILL_NBR_CACHE": _______ UIP_CONF_ND6_AUTOFILL_NBR_CACHE -##### "UIP_CONF_ND6_SEND_NA": __________________ UIP_CONF_ND6_SEND_NA +##### "UIP_TCP_CONNS": _________________________ UIP_TCP_CONNS +##### "UIP_ND6_SEND_RA": _______________________ UIP_ND6_SEND_RA +##### "UIP_ND6_SEND_NS": _______________________ UIP_ND6_SEND_NS +##### "UIP_ND6_SEND_NA": _______________________ UIP_ND6_SEND_NA +##### "UIP_ND6_AUTOFILL_NBR_CACHE": ____________ UIP_ND6_AUTOFILL_NBR_CACHE ##### "SICSLOWPAN_CONF_FRAG": __________________ SICSLOWPAN_CONF_FRAG -##### "SICSLOWPAN_CONF_MAC_MAX_PAYLOAD": _______ SICSLOWPAN_CONF_MAC_MAX_PAYLOAD -##### "SICSLOWPAN_CONF_COMPRESSION": ___________ SICSLOWPAN_CONF_COMPRESSION +##### "SICSLOWPAN_COMPRESSION": ________________ SICSLOWPAN_COMPRESSION +##### "LOG_CONF_LEVEL_RPL": ____________________ LOG_CONF_LEVEL_RPL +##### "LOG_CONF_LEVEL_TCPIP": __________________ LOG_CONF_LEVEL_TCPIP +##### "LOG_CONF_LEVEL_IPV6": ___________________ LOG_CONF_LEVEL_IPV6 +##### "LOG_CONF_LEVEL_6LOWPAN": ________________ LOG_CONF_LEVEL_6LOWPAN +##### "LOG_CONF_LEVEL_NULLNET": ________________ LOG_CONF_LEVEL_NULLNET +##### "LOG_CONF_LEVEL_MAC": ____________________ LOG_CONF_LEVEL_MAC +##### "LOG_CONF_LEVEL_FRAMER": _________________ LOG_CONF_LEVEL_FRAMER +##### "LOG_CONF_LEVEL_6TOP": ___________________ LOG_CONF_LEVEL_6TOP