diff --git a/.gitignore b/.gitignore index 0ff1ebfa2..811266435 100644 --- a/.gitignore +++ b/.gitignore @@ -36,7 +36,7 @@ COOJA.testlog *.simplelink *.sky *.firmware -*.srf06-cc26xx +*.cc26x0-cc13x0 *.zoul # do not ignore platform makefiles @@ -47,7 +47,7 @@ COOJA.testlog !Makefile.nrf52dk !Makefile.openmote-cc2538 !Makefile.sky -!Makefile.srf06-cc26xx +!Makefile.cc26x0-cc13x0 !Makefile.zoul # other nRF52 build artifacts diff --git a/.gitmodules b/.gitmodules index ed5ea056d..6481bbb93 100644 --- a/.gitmodules +++ b/.gitmodules @@ -2,10 +2,10 @@ path = tools/cc2538-bsl url = https://github.com/JelmerT/cc2538-bsl.git [submodule "arch/cpu/cc26xx-cc13xx/lib/cc26xxware"] - path = arch/cpu/cc26xx-cc13xx/lib/cc26xxware + path = arch/cpu/cc26x0-cc13x0/lib/cc26xxware url = https://github.com/contiki-ng/cc26xxware.git [submodule "arch/cpu/cc26xx-cc13xx/lib/cc13xxware"] - path = arch/cpu/cc26xx-cc13xx/lib/cc13xxware + path = arch/cpu/cc26x0-cc13x0/lib/cc13xxware url = https://github.com/contiki-ng/cc13xxware.git [submodule "tools/sensniff"] path = tools/sensniff @@ -26,5 +26,5 @@ path = arch/cpu/simplelink-cc13xx-cc26xx/lib/coresdk_cc13xx_cc26xx url = https://github.com/contiki-ng/coresdk_cc13xx_cc26xx.git [submodule "arch/cpu/cc26xx-cc13xx/lib/cc2640r2-sdk"] - path = arch/cpu/cc26xx-cc13xx/lib/cc2640r2-sdk + path = arch/cpu/cc26x0-cc13x0/lib/cc2640r2-sdk url = https://github.com/contiki-ng/cc2640r2-sdk.git diff --git a/.travis.yml b/.travis.yml index f5a58c609..d9c98d75d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,8 +30,10 @@ before_install: docker push $DOCKER_IMG; fi fi - # Build Cooja - - ant -q -f $CNG_HOST_PATH/tools/cooja/build.xml jar + # Build Cooja conditionally + - if [ ${BUILD_COOJA:-false} = true ] ; then + ant -q -f $CNG_HOST_PATH/tools/cooja/build.xml jar ; + fi # Set permissions for Docker mount - sudo chgrp -hR 1000 $CNG_HOST_PATH @@ -55,14 +57,15 @@ env: - TEST_NAME='compile-base' - TEST_NAME='compile-arm-ports-01' - TEST_NAME='compile-arm-ports-02' - - TEST_NAME='rpl-lite' - - TEST_NAME='rpl-classic' - - TEST_NAME='tun-rpl-br' + - TEST_NAME='rpl-lite' BUILD_COOJA=true + - TEST_NAME='rpl-classic' BUILD_COOJA=true + - TEST_NAME='tun-rpl-br' BUILD_COOJA=true - TEST_NAME='coap-lwm2m' - - TEST_NAME='simulation-base' - - TEST_NAME='ieee802154' + - TEST_NAME='simulation-base' BUILD_COOJA=true + - TEST_NAME='ieee802154' BUILD_COOJA=true - TEST_NAME='compile-nxp-ports' - TEST_NAME='documentation' - TEST_NAME='compile-tools' - TEST_NAME='native-runs' - - TEST_NAME='ipv6' + - TEST_NAME='ipv6' BUILD_COOJA=true + - TEST_NAME='ipv6-nbr' BUILD_COOJA=true diff --git a/Makefile.embedded b/Makefile.embedded index 4654626c4..e6841926b 100644 --- a/Makefile.embedded +++ b/Makefile.embedded @@ -3,6 +3,9 @@ # Future extensions to the build system that are of a similar nature (for # embedded devices only), can be achieved by extending this Makefile here. +### +### Targets using the tools/serial-io +### RLWRAPGOALS = login serialdump serialview .PHONY: $(RLWRAPGOALS) @@ -31,3 +34,14 @@ serialview: $(SERIAL_DUMP_BIN) login: $(SERIAL_DUMP_BIN) $(SERIALDUMP) -b$(BAUDRATE) $(PORT) + +### +### Targets using tools/motelist +### +CONTIKI_NG_MOTELIST_DIR = $(TOOLS_DIR)/motelist +CONTIKI_NG_MOTELIST = python $(CONTIKI_NG_MOTELIST_DIR)/motelist.py + +.PHONY: motelist-all + +motelist-all: + $(CONTIKI_NG_MOTELIST) diff --git a/Makefile.help b/Makefile.help new file mode 100644 index 000000000..d8de20c00 --- /dev/null +++ b/Makefile.help @@ -0,0 +1,29 @@ +usage: + @echo "Usage:" + @echo " make [TARGET=(TARGET)] [BOARD=(BOARD)] [DEFINES=(DEFINES)] [PORT=(PORT)] [target]" + @echo "" + @echo "Typical usage:" + @echo " make [TARGET=(TARGET)] [BOARD=(BOARD)] [all]" + @echo "" + @echo " Will build Contiki-NG firmware(s) from the current example dir" + @echo " for platform TARGET, board BOARD." + @echo "" + @echo "Miscellaneous targets:" + @echo " targets Prints list of supported platforms" + @echo " boards Prints a list of supported boards for TARGET" + @echo " savetarget Saves TARGET and BOARD for future invocations of make" + @echo " savedefines Saves DEFINES for future invocations of make" + @echo " clean Removes all compiled files for TARGET" + @echo " distclean Removes all compiled files for all TARGETs" + @echo " viewconf Prints Contiki-NG build configuration for TARGET" + @echo " %.flashprof Shows a Flash/ROM profile of a given firmware (e.g. hello-world.flashprof)" + @echo " %.ramprof Shows a RAM profile of a given firmware (e.g. hello-world.ramprof)" + @echo " %.o Produces an object file from a given source file (e.g. hello-world.o)" + @echo " %.e Produces the pre-processed version of a given source file (e.g. hello-world.e)" + @echo " %.s Produces an assembly file from a given source file (e.g. hello-world.s)" + @echo " login View the serial output of the device connected to PORT" + @echo " serialview Same as login, but prepend serial output with a unix timestamp" + @echo " serialdump same as serialview, but also save the output to a file" + @echo " motelist-all Prints a list of connected devices" + +help: usage diff --git a/Makefile.include b/Makefile.include index 3578730eb..a194274bd 100644 --- a/Makefile.include +++ b/Makefile.include @@ -395,34 +395,7 @@ endif %.flashprof: %.$(TARGET) $(NM) -S -td --size-sort $< | grep -i " [t] " | cut -d' ' -f2,4 -usage: - @echo "Usage:" - @echo " make [TARGET=(TARGET)] [BOARD=(BOARD)] [DEFINES=(DEFINES)] [PORT=(PORT)] [target]" - @echo "" - @echo "Typical usage:" - @echo " make [TARGET=(TARGET)] [BOARD=(BOARD)] [all]" - @echo "" - @echo " Will build Contiki-NG firmware(s) from the current example dir" - @echo " for platform TARGET, board BOARD." - @echo "" - @echo "Miscellaneous targets:" - @echo " targets Prints list of supported platforms" - @echo " boards Prints a list of supported boards for TARGET" - @echo " savetarget Saves TARGET and BOARD for future invocations of make" - @echo " savedefines Saves DEFINES for future invocations of make" - @echo " clean Removes all compiled files for TARGET" - @echo " distclean Removes all compiled files for all TARGETs" - @echo " viewconf Prints Contiki-NG build configuration for TARGET" - @echo " %.flashprof Shows a Flash/ROM profile of a given firmware (e.g. hello-world.flashprof)" - @echo " %.ramprof Shows a RAM profile of a given firmware (e.g. hello-world.ramprof)" - @echo " %.o Produces an object file from a given source file (e.g. hello-world.o)" - @echo " %.e Produces the pre-processed version of a given source file (e.g. hello-world.e)" - @echo " %.s Produces an assembly file from a given source file (e.g. hello-world.s)" - @echo " login View the serial output of the device connected to PORT" - @echo " serialview Same as login, but prepend serial output with a unix timestamp" - @echo " serialdump same as serialview, but also save the output to a file" - -help: usage +include $(CONTIKI)/Makefile.help targets: @ls $(CONTIKI)/arch/platform $(TARGETDIRS) diff --git a/arch/cpu/cc26xx-cc13xx/Makefile.cc13xx b/arch/cpu/cc26x0-cc13x0/Makefile.cc13x0 similarity index 80% rename from arch/cpu/cc26xx-cc13xx/Makefile.cc13xx rename to arch/cpu/cc26x0-cc13x0/Makefile.cc13x0 index 5ea92e30c..c29ee7270 100644 --- a/arch/cpu/cc26xx-cc13xx/Makefile.cc13xx +++ b/arch/cpu/cc26x0-cc13x0/Makefile.cc13x0 @@ -4,4 +4,4 @@ CONTIKI_CPU_SOURCEFILES += smartrf-settings.c prop-mode.c prop-mode-tx-power.c c CFLAGS += -DCPU_FAMILY_CC13X0=1 -DCPU_FAMILY_CC13XX=1 -include $(CONTIKI_CPU)/Makefile.cc26xx-cc13xx +include $(CONTIKI_CPU)/Makefile.cc26x0-cc13x0 diff --git a/arch/cpu/cc26xx-cc13xx/Makefile.cc26xx b/arch/cpu/cc26x0-cc13x0/Makefile.cc26x0 similarity index 65% rename from arch/cpu/cc26xx-cc13xx/Makefile.cc26xx rename to arch/cpu/cc26x0-cc13x0/Makefile.cc26x0 index 34a147f7b..51db3f205 100644 --- a/arch/cpu/cc26xx-cc13xx/Makefile.cc26xx +++ b/arch/cpu/cc26x0-cc13x0/Makefile.cc26x0 @@ -2,4 +2,4 @@ TI_XXWARE_PATH = lib/cc26xxware CFLAGS += -DCPU_FAMILY_CC26X0=1 -DCPU_FAMILY_CC26XX=1 -include $(CONTIKI_CPU)/Makefile.cc26xx-cc13xx +include $(CONTIKI_CPU)/Makefile.cc26x0-cc13x0 diff --git a/arch/cpu/cc26xx-cc13xx/Makefile.cc26xx-cc13xx b/arch/cpu/cc26x0-cc13x0/Makefile.cc26x0-cc13x0 similarity index 96% rename from arch/cpu/cc26xx-cc13xx/Makefile.cc26xx-cc13xx rename to arch/cpu/cc26x0-cc13x0/Makefile.cc26x0-cc13x0 index 00f9ae232..e62b8be05 100644 --- a/arch/cpu/cc26xx-cc13xx/Makefile.cc26xx-cc13xx +++ b/arch/cpu/cc26x0-cc13x0/Makefile.cc26x0-cc13x0 @@ -1,8 +1,8 @@ -CPU_ABS_PATH = arch/cpu/cc26xx-cc13xx +CPU_ABS_PATH = arch/cpu/cc26x0-cc13x0 TI_XXWARE = $(CONTIKI_CPU)/$(TI_XXWARE_PATH) -ifeq (,$(wildcard $(TI_XXWARE))) - $(warning $(TI_XXWARE) does not exist.) +ifeq (,$(wildcard $(TI_XXWARE)/*)) + $(warning $(TI_XXWARE) does not exist or is empty.) $(warning Did you run 'git submodule update --init' ?) $(error "") endif diff --git a/arch/cpu/cc26xx-cc13xx/Makefile.cc26x0r2f b/arch/cpu/cc26x0-cc13x0/Makefile.cc26x0r2f similarity index 67% rename from arch/cpu/cc26xx-cc13xx/Makefile.cc26x0r2f rename to arch/cpu/cc26x0-cc13x0/Makefile.cc26x0r2f index 56d041516..5118cd6a8 100644 --- a/arch/cpu/cc26xx-cc13xx/Makefile.cc26x0r2f +++ b/arch/cpu/cc26x0-cc13x0/Makefile.cc26x0r2f @@ -2,4 +2,4 @@ TI_XXWARE_PATH = lib/cc2640r2-sdk CFLAGS += -DCPU_FAMILY_CC26X0R2=1 -DCPU_FAMILY_CC26XXR2=1 -include $(CONTIKI_CPU)/Makefile.cc26xx-cc13xx +include $(CONTIKI_CPU)/Makefile.cc26x0-cc13x0 diff --git a/arch/cpu/cc26xx-cc13xx/ble-addr.c b/arch/cpu/cc26x0-cc13x0/ble-addr.c similarity index 100% rename from arch/cpu/cc26xx-cc13xx/ble-addr.c rename to arch/cpu/cc26x0-cc13x0/ble-addr.c diff --git a/arch/cpu/cc26xx-cc13xx/ble-addr.h b/arch/cpu/cc26x0-cc13x0/ble-addr.h similarity index 100% rename from arch/cpu/cc26xx-cc13xx/ble-addr.h rename to arch/cpu/cc26x0-cc13x0/ble-addr.h diff --git a/arch/cpu/cc26xx-cc13xx/cc13x0-cc26x0-cm3.h b/arch/cpu/cc26x0-cc13x0/cc13x0-cc26x0-cm3.h similarity index 100% rename from arch/cpu/cc26xx-cc13xx/cc13x0-cc26x0-cm3.h rename to arch/cpu/cc26x0-cc13x0/cc13x0-cc26x0-cm3.h diff --git a/arch/cpu/cc26xx-cc13xx/cc13xx-cc26xx-conf.h b/arch/cpu/cc26x0-cc13x0/cc13xx-cc26xx-conf.h similarity index 100% rename from arch/cpu/cc26xx-cc13xx/cc13xx-cc26xx-conf.h rename to arch/cpu/cc26x0-cc13x0/cc13xx-cc26xx-conf.h diff --git a/arch/cpu/cc26xx-cc13xx/cc13xx-cc26xx-def.h b/arch/cpu/cc26x0-cc13x0/cc13xx-cc26xx-def.h similarity index 100% rename from arch/cpu/cc26xx-cc13xx/cc13xx-cc26xx-def.h rename to arch/cpu/cc26x0-cc13x0/cc13xx-cc26xx-def.h diff --git a/arch/cpu/cc26xx-cc13xx/cc26xx.ld b/arch/cpu/cc26x0-cc13x0/cc26xx.ld similarity index 100% rename from arch/cpu/cc26xx-cc13xx/cc26xx.ld rename to arch/cpu/cc26x0-cc13x0/cc26xx.ld diff --git a/arch/cpu/cc26xx-cc13xx/ccxxware-conf.h b/arch/cpu/cc26x0-cc13x0/ccxxware-conf.h similarity index 98% rename from arch/cpu/cc26xx-cc13xx/ccxxware-conf.h rename to arch/cpu/cc26x0-cc13x0/ccxxware-conf.h index bc26f1171..c101deb08 100644 --- a/arch/cpu/cc26xx-cc13xx/ccxxware-conf.h +++ b/arch/cpu/cc26x0-cc13x0/ccxxware-conf.h @@ -36,7 +36,7 @@ * @{ * * \file - * CCxxware-specific configuration for the cc26xx-cc13xx CPU family + * CCxxware-specific configuration for the cc26x0-cc13x0 CPU family */ #ifndef CCXXWARE_CONF_H_ #define CCXXWARE_CONF_H_ diff --git a/arch/cpu/cc26xx-cc13xx/clock.c b/arch/cpu/cc26x0-cc13x0/clock.c similarity index 100% rename from arch/cpu/cc26xx-cc13xx/clock.c rename to arch/cpu/cc26x0-cc13x0/clock.c diff --git a/arch/cpu/cc26xx-cc13xx/dbg.c b/arch/cpu/cc26x0-cc13x0/dbg.c similarity index 100% rename from arch/cpu/cc26xx-cc13xx/dbg.c rename to arch/cpu/cc26x0-cc13x0/dbg.c diff --git a/arch/cpu/cc26xx-cc13xx/dev/adc-sensor.c b/arch/cpu/cc26x0-cc13x0/dev/adc-sensor.c similarity index 100% rename from arch/cpu/cc26xx-cc13xx/dev/adc-sensor.c rename to arch/cpu/cc26x0-cc13x0/dev/adc-sensor.c diff --git a/arch/cpu/cc26xx-cc13xx/dev/adc-sensor.h b/arch/cpu/cc26x0-cc13x0/dev/adc-sensor.h similarity index 100% rename from arch/cpu/cc26xx-cc13xx/dev/adc-sensor.h rename to arch/cpu/cc26x0-cc13x0/dev/adc-sensor.h diff --git a/arch/cpu/cc26xx-cc13xx/dev/aux-ctrl.c b/arch/cpu/cc26x0-cc13x0/dev/aux-ctrl.c similarity index 100% rename from arch/cpu/cc26xx-cc13xx/dev/aux-ctrl.c rename to arch/cpu/cc26x0-cc13x0/dev/aux-ctrl.c diff --git a/arch/cpu/cc26xx-cc13xx/dev/aux-ctrl.h b/arch/cpu/cc26x0-cc13x0/dev/aux-ctrl.h similarity index 100% rename from arch/cpu/cc26xx-cc13xx/dev/aux-ctrl.h rename to arch/cpu/cc26x0-cc13x0/dev/aux-ctrl.h diff --git a/arch/cpu/cc26xx-cc13xx/dev/batmon-sensor.c b/arch/cpu/cc26x0-cc13x0/dev/batmon-sensor.c similarity index 100% rename from arch/cpu/cc26xx-cc13xx/dev/batmon-sensor.c rename to arch/cpu/cc26x0-cc13x0/dev/batmon-sensor.c diff --git a/arch/cpu/cc26xx-cc13xx/dev/batmon-sensor.h b/arch/cpu/cc26x0-cc13x0/dev/batmon-sensor.h similarity index 100% rename from arch/cpu/cc26xx-cc13xx/dev/batmon-sensor.h rename to arch/cpu/cc26x0-cc13x0/dev/batmon-sensor.h diff --git a/arch/cpu/cc26xx-cc13xx/dev/cc26xx-uart.c b/arch/cpu/cc26x0-cc13x0/dev/cc26xx-uart.c similarity index 100% rename from arch/cpu/cc26xx-cc13xx/dev/cc26xx-uart.c rename to arch/cpu/cc26x0-cc13x0/dev/cc26xx-uart.c diff --git a/arch/cpu/cc26xx-cc13xx/dev/cc26xx-uart.h b/arch/cpu/cc26x0-cc13x0/dev/cc26xx-uart.h similarity index 100% rename from arch/cpu/cc26xx-cc13xx/dev/cc26xx-uart.h rename to arch/cpu/cc26x0-cc13x0/dev/cc26xx-uart.h diff --git a/arch/cpu/cc26xx-cc13xx/dev/contiki-watchdog.c b/arch/cpu/cc26x0-cc13x0/dev/contiki-watchdog.c similarity index 100% rename from arch/cpu/cc26xx-cc13xx/dev/contiki-watchdog.c rename to arch/cpu/cc26x0-cc13x0/dev/contiki-watchdog.c diff --git a/arch/cpu/cc26xx-cc13xx/dev/gpio-hal-arch.c b/arch/cpu/cc26x0-cc13x0/dev/gpio-hal-arch.c similarity index 100% rename from arch/cpu/cc26xx-cc13xx/dev/gpio-hal-arch.c rename to arch/cpu/cc26x0-cc13x0/dev/gpio-hal-arch.c diff --git a/arch/cpu/cc26xx-cc13xx/dev/gpio-hal-arch.h b/arch/cpu/cc26x0-cc13x0/dev/gpio-hal-arch.h similarity index 100% rename from arch/cpu/cc26xx-cc13xx/dev/gpio-hal-arch.h rename to arch/cpu/cc26x0-cc13x0/dev/gpio-hal-arch.h diff --git a/arch/cpu/cc26xx-cc13xx/dev/gpio-interrupt.c b/arch/cpu/cc26x0-cc13x0/dev/gpio-interrupt.c similarity index 100% rename from arch/cpu/cc26xx-cc13xx/dev/gpio-interrupt.c rename to arch/cpu/cc26x0-cc13x0/dev/gpio-interrupt.c diff --git a/arch/cpu/cc26xx-cc13xx/dev/oscillators.c b/arch/cpu/cc26x0-cc13x0/dev/oscillators.c similarity index 100% rename from arch/cpu/cc26xx-cc13xx/dev/oscillators.c rename to arch/cpu/cc26x0-cc13x0/dev/oscillators.c diff --git a/arch/cpu/cc26xx-cc13xx/dev/oscillators.h b/arch/cpu/cc26x0-cc13x0/dev/oscillators.h similarity index 100% rename from arch/cpu/cc26xx-cc13xx/dev/oscillators.h rename to arch/cpu/cc26x0-cc13x0/dev/oscillators.h diff --git a/arch/cpu/cc26xx-cc13xx/dev/soc-rtc.c b/arch/cpu/cc26x0-cc13x0/dev/soc-rtc.c similarity index 100% rename from arch/cpu/cc26xx-cc13xx/dev/soc-rtc.c rename to arch/cpu/cc26x0-cc13x0/dev/soc-rtc.c diff --git a/arch/cpu/cc26xx-cc13xx/dev/soc-rtc.h b/arch/cpu/cc26x0-cc13x0/dev/soc-rtc.h similarity index 100% rename from arch/cpu/cc26xx-cc13xx/dev/soc-rtc.h rename to arch/cpu/cc26x0-cc13x0/dev/soc-rtc.h diff --git a/arch/cpu/cc26xx-cc13xx/dev/soc-trng.c b/arch/cpu/cc26x0-cc13x0/dev/soc-trng.c similarity index 100% rename from arch/cpu/cc26xx-cc13xx/dev/soc-trng.c rename to arch/cpu/cc26x0-cc13x0/dev/soc-trng.c diff --git a/arch/cpu/cc26xx-cc13xx/dev/soc-trng.h b/arch/cpu/cc26x0-cc13x0/dev/soc-trng.h similarity index 100% rename from arch/cpu/cc26xx-cc13xx/dev/soc-trng.h rename to arch/cpu/cc26x0-cc13x0/dev/soc-trng.h diff --git a/arch/cpu/cc26xx-cc13xx/dev/spi-arch.c b/arch/cpu/cc26x0-cc13x0/dev/spi-arch.c similarity index 100% rename from arch/cpu/cc26xx-cc13xx/dev/spi-arch.c rename to arch/cpu/cc26x0-cc13x0/dev/spi-arch.c diff --git a/arch/cpu/cc26xx-cc13xx/doxygen-group.txt b/arch/cpu/cc26x0-cc13x0/doxygen-group.txt similarity index 100% rename from arch/cpu/cc26xx-cc13xx/doxygen-group.txt rename to arch/cpu/cc26x0-cc13x0/doxygen-group.txt diff --git a/arch/cpu/cc26xx-cc13xx/fault-handlers.c b/arch/cpu/cc26x0-cc13x0/fault-handlers.c similarity index 100% rename from arch/cpu/cc26xx-cc13xx/fault-handlers.c rename to arch/cpu/cc26x0-cc13x0/fault-handlers.c diff --git a/arch/cpu/cc26xx-cc13xx/ieee-addr.c b/arch/cpu/cc26x0-cc13x0/ieee-addr.c similarity index 100% rename from arch/cpu/cc26xx-cc13xx/ieee-addr.c rename to arch/cpu/cc26x0-cc13x0/ieee-addr.c diff --git a/arch/cpu/cc26xx-cc13xx/ieee-addr.h b/arch/cpu/cc26x0-cc13x0/ieee-addr.h similarity index 100% rename from arch/cpu/cc26xx-cc13xx/ieee-addr.h rename to arch/cpu/cc26x0-cc13x0/ieee-addr.h diff --git a/arch/cpu/cc26xx-cc13xx/int-master.c b/arch/cpu/cc26x0-cc13x0/int-master.c similarity index 100% rename from arch/cpu/cc26xx-cc13xx/int-master.c rename to arch/cpu/cc26x0-cc13x0/int-master.c diff --git a/arch/cpu/cc26xx-cc13xx/lib/cc13xxware b/arch/cpu/cc26x0-cc13x0/lib/cc13xxware similarity index 100% rename from arch/cpu/cc26xx-cc13xx/lib/cc13xxware rename to arch/cpu/cc26x0-cc13x0/lib/cc13xxware diff --git a/arch/cpu/cc26xx-cc13xx/lib/cc2640r2-sdk b/arch/cpu/cc26x0-cc13x0/lib/cc2640r2-sdk similarity index 100% rename from arch/cpu/cc26xx-cc13xx/lib/cc2640r2-sdk rename to arch/cpu/cc26x0-cc13x0/lib/cc2640r2-sdk diff --git a/arch/cpu/cc26xx-cc13xx/lib/cc26xxware b/arch/cpu/cc26x0-cc13x0/lib/cc26xxware similarity index 100% rename from arch/cpu/cc26xx-cc13xx/lib/cc26xxware rename to arch/cpu/cc26x0-cc13x0/lib/cc26xxware diff --git a/arch/cpu/cc26xx-cc13xx/lpm.c b/arch/cpu/cc26x0-cc13x0/lpm.c similarity index 100% rename from arch/cpu/cc26xx-cc13xx/lpm.c rename to arch/cpu/cc26x0-cc13x0/lpm.c diff --git a/arch/cpu/cc26xx-cc13xx/lpm.h b/arch/cpu/cc26x0-cc13x0/lpm.h similarity index 100% rename from arch/cpu/cc26xx-cc13xx/lpm.h rename to arch/cpu/cc26x0-cc13x0/lpm.h diff --git a/arch/cpu/cc26xx-cc13xx/random.c b/arch/cpu/cc26x0-cc13x0/random.c similarity index 100% rename from arch/cpu/cc26xx-cc13xx/random.c rename to arch/cpu/cc26x0-cc13x0/random.c diff --git a/arch/cpu/cc26xx-cc13xx/rf-core/api/ieee_cmd.h b/arch/cpu/cc26x0-cc13x0/rf-core/api/ieee_cmd.h similarity index 100% rename from arch/cpu/cc26xx-cc13xx/rf-core/api/ieee_cmd.h rename to arch/cpu/cc26x0-cc13x0/rf-core/api/ieee_cmd.h diff --git a/arch/cpu/cc26xx-cc13xx/rf-core/api/ieee_mailbox.h b/arch/cpu/cc26x0-cc13x0/rf-core/api/ieee_mailbox.h similarity index 100% rename from arch/cpu/cc26xx-cc13xx/rf-core/api/ieee_mailbox.h rename to arch/cpu/cc26x0-cc13x0/rf-core/api/ieee_mailbox.h diff --git a/arch/cpu/cc26xx-cc13xx/rf-core/ble-cc2650.c b/arch/cpu/cc26x0-cc13x0/rf-core/ble-cc2650.c similarity index 100% rename from arch/cpu/cc26xx-cc13xx/rf-core/ble-cc2650.c rename to arch/cpu/cc26x0-cc13x0/rf-core/ble-cc2650.c diff --git a/arch/cpu/cc26xx-cc13xx/rf-core/ble-hal/ble-hal-cc26xx.c b/arch/cpu/cc26x0-cc13x0/rf-core/ble-hal/ble-hal-cc26xx.c similarity index 100% rename from arch/cpu/cc26xx-cc13xx/rf-core/ble-hal/ble-hal-cc26xx.c rename to arch/cpu/cc26x0-cc13x0/rf-core/ble-hal/ble-hal-cc26xx.c diff --git a/arch/cpu/cc26xx-cc13xx/rf-core/ble-hal/ble-hal-cc26xx.h b/arch/cpu/cc26x0-cc13x0/rf-core/ble-hal/ble-hal-cc26xx.h similarity index 100% rename from arch/cpu/cc26xx-cc13xx/rf-core/ble-hal/ble-hal-cc26xx.h rename to arch/cpu/cc26x0-cc13x0/rf-core/ble-hal/ble-hal-cc26xx.h diff --git a/arch/cpu/cc26xx-cc13xx/rf-core/ble-hal/rf-ble-cmd.c b/arch/cpu/cc26x0-cc13x0/rf-core/ble-hal/rf-ble-cmd.c similarity index 100% rename from arch/cpu/cc26xx-cc13xx/rf-core/ble-hal/rf-ble-cmd.c rename to arch/cpu/cc26x0-cc13x0/rf-core/ble-hal/rf-ble-cmd.c diff --git a/arch/cpu/cc26xx-cc13xx/rf-core/ble-hal/rf-ble-cmd.h b/arch/cpu/cc26x0-cc13x0/rf-core/ble-hal/rf-ble-cmd.h similarity index 100% rename from arch/cpu/cc26xx-cc13xx/rf-core/ble-hal/rf-ble-cmd.h rename to arch/cpu/cc26x0-cc13x0/rf-core/ble-hal/rf-ble-cmd.h diff --git a/arch/cpu/cc26xx-cc13xx/rf-core/cc13xx-50kbps-tsch.c b/arch/cpu/cc26x0-cc13x0/rf-core/cc13xx-50kbps-tsch.c similarity index 100% rename from arch/cpu/cc26xx-cc13xx/rf-core/cc13xx-50kbps-tsch.c rename to arch/cpu/cc26x0-cc13x0/rf-core/cc13xx-50kbps-tsch.c diff --git a/arch/cpu/cc26xx-cc13xx/rf-core/cc13xx-50kbps-tsch.h b/arch/cpu/cc26x0-cc13x0/rf-core/cc13xx-50kbps-tsch.h similarity index 100% rename from arch/cpu/cc26xx-cc13xx/rf-core/cc13xx-50kbps-tsch.h rename to arch/cpu/cc26x0-cc13x0/rf-core/cc13xx-50kbps-tsch.h diff --git a/arch/cpu/cc26xx-cc13xx/rf-core/dot-15-4g.h b/arch/cpu/cc26x0-cc13x0/rf-core/dot-15-4g.h similarity index 100% rename from arch/cpu/cc26xx-cc13xx/rf-core/dot-15-4g.h rename to arch/cpu/cc26x0-cc13x0/rf-core/dot-15-4g.h diff --git a/arch/cpu/cc26xx-cc13xx/rf-core/ieee-mode.c b/arch/cpu/cc26x0-cc13x0/rf-core/ieee-mode.c similarity index 100% rename from arch/cpu/cc26xx-cc13xx/rf-core/ieee-mode.c rename to arch/cpu/cc26x0-cc13x0/rf-core/ieee-mode.c diff --git a/arch/cpu/cc26xx-cc13xx/rf-core/prop-mode-tx-power.c b/arch/cpu/cc26x0-cc13x0/rf-core/prop-mode-tx-power.c similarity index 100% rename from arch/cpu/cc26xx-cc13xx/rf-core/prop-mode-tx-power.c rename to arch/cpu/cc26x0-cc13x0/rf-core/prop-mode-tx-power.c diff --git a/arch/cpu/cc26xx-cc13xx/rf-core/prop-mode.c b/arch/cpu/cc26x0-cc13x0/rf-core/prop-mode.c similarity index 100% rename from arch/cpu/cc26xx-cc13xx/rf-core/prop-mode.c rename to arch/cpu/cc26x0-cc13x0/rf-core/prop-mode.c diff --git a/arch/cpu/cc26xx-cc13xx/rf-core/prop-mode.h b/arch/cpu/cc26x0-cc13x0/rf-core/prop-mode.h similarity index 100% rename from arch/cpu/cc26xx-cc13xx/rf-core/prop-mode.h rename to arch/cpu/cc26x0-cc13x0/rf-core/prop-mode.h diff --git a/arch/cpu/cc26xx-cc13xx/rf-core/rf-ble.c b/arch/cpu/cc26x0-cc13x0/rf-core/rf-ble.c similarity index 100% rename from arch/cpu/cc26xx-cc13xx/rf-core/rf-ble.c rename to arch/cpu/cc26x0-cc13x0/rf-core/rf-ble.c diff --git a/arch/cpu/cc26xx-cc13xx/rf-core/rf-ble.h b/arch/cpu/cc26x0-cc13x0/rf-core/rf-ble.h similarity index 100% rename from arch/cpu/cc26xx-cc13xx/rf-core/rf-ble.h rename to arch/cpu/cc26x0-cc13x0/rf-core/rf-ble.h diff --git a/arch/cpu/cc26xx-cc13xx/rf-core/rf-core.c b/arch/cpu/cc26x0-cc13x0/rf-core/rf-core.c similarity index 99% rename from arch/cpu/cc26xx-cc13xx/rf-core/rf-core.c rename to arch/cpu/cc26x0-cc13x0/rf-core/rf-core.c index db3c6adb3..7e638509d 100644 --- a/arch/cpu/cc26xx-cc13xx/rf-core/rf-core.c +++ b/arch/cpu/cc26x0-cc13x0/rf-core/rf-core.c @@ -512,9 +512,13 @@ rf_core_setup_interrupts(void) void rf_core_cmd_done_en(bool fg) { - uint32_t irq = fg ? IRQ_LAST_FG_COMMAND_DONE : IRQ_LAST_COMMAND_DONE; + uint32_t irq = 0; const uint32_t enabled_irqs = rf_core_poll_mode ? ENABLED_IRQS_POLL_MODE : ENABLED_IRQS; + if(!rf_core_poll_mode) { + irq = fg ? IRQ_LAST_FG_COMMAND_DONE : IRQ_LAST_COMMAND_DONE; + } + HWREG(RFC_DBELL_NONBUF_BASE + RFC_DBELL_O_RFCPEIFG) = enabled_irqs; HWREG(RFC_DBELL_NONBUF_BASE + RFC_DBELL_O_RFCPEIEN) = enabled_irqs | irq; } diff --git a/arch/cpu/cc26xx-cc13xx/rf-core/rf-core.h b/arch/cpu/cc26x0-cc13x0/rf-core/rf-core.h similarity index 100% rename from arch/cpu/cc26xx-cc13xx/rf-core/rf-core.h rename to arch/cpu/cc26x0-cc13x0/rf-core/rf-core.h diff --git a/arch/cpu/cc26xx-cc13xx/rf-core/rf-switch.h b/arch/cpu/cc26x0-cc13x0/rf-core/rf-switch.h similarity index 100% rename from arch/cpu/cc26xx-cc13xx/rf-core/rf-switch.h rename to arch/cpu/cc26x0-cc13x0/rf-core/rf-switch.h diff --git a/arch/cpu/cc26xx-cc13xx/rf-core/smartrf-settings.c b/arch/cpu/cc26x0-cc13x0/rf-core/smartrf-settings.c similarity index 100% rename from arch/cpu/cc26xx-cc13xx/rf-core/smartrf-settings.c rename to arch/cpu/cc26x0-cc13x0/rf-core/smartrf-settings.c diff --git a/arch/cpu/cc26xx-cc13xx/rf-core/smartrf-settings.h b/arch/cpu/cc26x0-cc13x0/rf-core/smartrf-settings.h similarity index 100% rename from arch/cpu/cc26xx-cc13xx/rf-core/smartrf-settings.h rename to arch/cpu/cc26x0-cc13x0/rf-core/smartrf-settings.h diff --git a/arch/cpu/cc26xx-cc13xx/rtimer-arch.c b/arch/cpu/cc26x0-cc13x0/rtimer-arch.c similarity index 100% rename from arch/cpu/cc26xx-cc13xx/rtimer-arch.c rename to arch/cpu/cc26x0-cc13x0/rtimer-arch.c diff --git a/arch/cpu/cc26xx-cc13xx/rtimer-arch.h b/arch/cpu/cc26x0-cc13x0/rtimer-arch.h similarity index 100% rename from arch/cpu/cc26xx-cc13xx/rtimer-arch.h rename to arch/cpu/cc26x0-cc13x0/rtimer-arch.h diff --git a/arch/cpu/cc26xx-cc13xx/slip-arch.c b/arch/cpu/cc26x0-cc13x0/slip-arch.c similarity index 100% rename from arch/cpu/cc26xx-cc13xx/slip-arch.c rename to arch/cpu/cc26x0-cc13x0/slip-arch.c diff --git a/arch/cpu/cc26xx-cc13xx/ti-lib.h b/arch/cpu/cc26x0-cc13x0/ti-lib.h similarity index 100% rename from arch/cpu/cc26xx-cc13xx/ti-lib.h rename to arch/cpu/cc26x0-cc13x0/ti-lib.h diff --git a/arch/cpu/simplelink-cc13xx-cc26xx/Makefile.cc13xx-cc26xx b/arch/cpu/simplelink-cc13xx-cc26xx/Makefile.cc13xx-cc26xx index dfd14637e..263c92b1b 100644 --- a/arch/cpu/simplelink-cc13xx-cc26xx/Makefile.cc13xx-cc26xx +++ b/arch/cpu/simplelink-cc13xx-cc26xx/Makefile.cc13xx-cc26xx @@ -3,7 +3,7 @@ CC13x2_CC26x2_PRE_RTM ?= 1 -# Core SDK is placed as a submodule under arch/cpu/cc13xx-cc26xx/lib. +# Core SDK is placed as a submodule under arch/cpu/simplelink-cc13xx-cc26xx/lib. # Do a sanity check that Core SDK submodule has been initialized. ifndef CORE_SDK CORE_SDK := $(CONTIKI_CPU)/lib/coresdk_cc13xx_cc26xx diff --git a/arch/platform/srf06-cc26xx/Makefile.srf06-cc26xx b/arch/platform/cc26x0-cc13x0/Makefile.cc26x0-cc13x0 similarity index 84% rename from arch/platform/srf06-cc26xx/Makefile.srf06-cc26xx rename to arch/platform/cc26x0-cc13x0/Makefile.cc26x0-cc13x0 index 03eefcf8b..43cc7ea3f 100644 --- a/arch/platform/srf06-cc26xx/Makefile.srf06-cc26xx +++ b/arch/platform/cc26x0-cc13x0/Makefile.cc26x0-cc13x0 @@ -1,12 +1,12 @@ -# srf06-cc26xx platform makefile +# cc26x0-cc13x0 platform makefile ifndef CONTIKI $(error CONTIKI not defined! You must specify where CONTIKI resides!) endif ### Board and BSP selection -BOARD ?= srf06/cc26xx -BOARDS = srf06/cc26xx srf06/cc13xx launchpad/cc2640r2 launchpad/cc2650 launchpad/cc1310 launchpad/cc1350 sensortag/cc2650 sensortag/cc1350 +BOARD ?= srf06/cc26x0 +BOARDS = srf06/cc26x0 srf06/cc13x0 launchpad/cc2640r2 launchpad/cc2650 launchpad/cc1310 launchpad/cc1350 sensortag/cc2650 sensortag/cc1350 CONTIKI_TARGET_DIRS += . @@ -25,5 +25,5 @@ SMALL ?= 0 ### Define the CPU directory and pull in the correct CPU makefile. This will ### be defined by one of the makefiles included above and it can be either ### Makefile.cc26xx or Makefile.cc13xx -CONTIKI_CPU=$(CONTIKI)/arch/cpu/cc26xx-cc13xx +CONTIKI_CPU=$(CONTIKI)/arch/cpu/cc26x0-cc13x0 include $(CONTIKI_CPU)/Makefile.$(CPU_FAMILY) diff --git a/arch/platform/srf06-cc26xx/cfs-coffee-arch.h b/arch/platform/cc26x0-cc13x0/cfs-coffee-arch.h similarity index 100% rename from arch/platform/srf06-cc26xx/cfs-coffee-arch.h rename to arch/platform/cc26x0-cc13x0/cfs-coffee-arch.h diff --git a/arch/platform/srf06-cc26xx/common/xmem.c b/arch/platform/cc26x0-cc13x0/common/xmem.c similarity index 100% rename from arch/platform/srf06-cc26xx/common/xmem.c rename to arch/platform/cc26x0-cc13x0/common/xmem.c diff --git a/arch/platform/srf06-cc26xx/contiki-conf.h b/arch/platform/cc26x0-cc13x0/contiki-conf.h similarity index 98% rename from arch/platform/srf06-cc26xx/contiki-conf.h rename to arch/platform/cc26x0-cc13x0/contiki-conf.h index 23c086db3..de61c102c 100644 --- a/arch/platform/srf06-cc26xx/contiki-conf.h +++ b/arch/platform/cc26x0-cc13x0/contiki-conf.h @@ -32,7 +32,7 @@ * @{ * * \file - * Configuration for the srf06-cc26xx platform + * Configuration for the cc26x0-cc13x0 platform */ #ifndef CONTIKI_CONF_H #define CONTIKI_CONF_H diff --git a/arch/platform/srf06-cc26xx/launchpad/Makefile.launchpad b/arch/platform/cc26x0-cc13x0/launchpad/Makefile.launchpad similarity index 100% rename from arch/platform/srf06-cc26xx/launchpad/Makefile.launchpad rename to arch/platform/cc26x0-cc13x0/launchpad/Makefile.launchpad diff --git a/arch/platform/srf06-cc26xx/launchpad/board-buttons.c b/arch/platform/cc26x0-cc13x0/launchpad/board-buttons.c similarity index 100% rename from arch/platform/srf06-cc26xx/launchpad/board-buttons.c rename to arch/platform/cc26x0-cc13x0/launchpad/board-buttons.c diff --git a/arch/platform/srf06-cc26xx/launchpad/board-peripherals.h b/arch/platform/cc26x0-cc13x0/launchpad/board-peripherals.h similarity index 100% rename from arch/platform/srf06-cc26xx/launchpad/board-peripherals.h rename to arch/platform/cc26x0-cc13x0/launchpad/board-peripherals.h diff --git a/arch/platform/srf06-cc26xx/launchpad/board.c b/arch/platform/cc26x0-cc13x0/launchpad/board.c similarity index 100% rename from arch/platform/srf06-cc26xx/launchpad/board.c rename to arch/platform/cc26x0-cc13x0/launchpad/board.c diff --git a/arch/platform/srf06-cc26xx/launchpad/cc1310/Makefile.cc1310 b/arch/platform/cc26x0-cc13x0/launchpad/cc1310/Makefile.cc1310 similarity index 91% rename from arch/platform/srf06-cc26xx/launchpad/cc1310/Makefile.cc1310 rename to arch/platform/cc26x0-cc13x0/launchpad/cc1310/Makefile.cc1310 index 8d3d2abd4..e9f7bab91 100644 --- a/arch/platform/srf06-cc26xx/launchpad/cc1310/Makefile.cc1310 +++ b/arch/platform/cc26x0-cc13x0/launchpad/cc1310/Makefile.cc1310 @@ -1,5 +1,5 @@ ### Will allow the inclusion of the correct CPU makefile -CPU_FAMILY = cc13xx +CPU_FAMILY = cc13x0 ### Add to the source dirs CONTIKI_TARGET_DIRS += launchpad/cc1310 diff --git a/arch/platform/srf06-cc26xx/launchpad/cc1310/board.h b/arch/platform/cc26x0-cc13x0/launchpad/cc1310/board.h similarity index 100% rename from arch/platform/srf06-cc26xx/launchpad/cc1310/board.h rename to arch/platform/cc26x0-cc13x0/launchpad/cc1310/board.h diff --git a/arch/platform/srf06-cc26xx/launchpad/cc1350/Makefile.cc1350 b/arch/platform/cc26x0-cc13x0/launchpad/cc1350/Makefile.cc1350 similarity index 93% rename from arch/platform/srf06-cc26xx/launchpad/cc1350/Makefile.cc1350 rename to arch/platform/cc26x0-cc13x0/launchpad/cc1350/Makefile.cc1350 index 0d1f65359..811a3f61b 100644 --- a/arch/platform/srf06-cc26xx/launchpad/cc1350/Makefile.cc1350 +++ b/arch/platform/cc26x0-cc13x0/launchpad/cc1350/Makefile.cc1350 @@ -1,5 +1,5 @@ ### Will allow the inclusion of the correct CPU makefile -CPU_FAMILY = cc13xx +CPU_FAMILY = cc13x0 ### Add to the source dirs CONTIKI_TARGET_DIRS += launchpad/cc1350 diff --git a/arch/platform/srf06-cc26xx/launchpad/cc1350/board.h b/arch/platform/cc26x0-cc13x0/launchpad/cc1350/board.h similarity index 100% rename from arch/platform/srf06-cc26xx/launchpad/cc1350/board.h rename to arch/platform/cc26x0-cc13x0/launchpad/cc1350/board.h diff --git a/arch/platform/srf06-cc26xx/launchpad/cc1350/rf-switch.c b/arch/platform/cc26x0-cc13x0/launchpad/cc1350/rf-switch.c similarity index 100% rename from arch/platform/srf06-cc26xx/launchpad/cc1350/rf-switch.c rename to arch/platform/cc26x0-cc13x0/launchpad/cc1350/rf-switch.c diff --git a/arch/platform/srf06-cc26xx/launchpad/cc1350/tx-power-driver.c b/arch/platform/cc26x0-cc13x0/launchpad/cc1350/tx-power-driver.c similarity index 100% rename from arch/platform/srf06-cc26xx/launchpad/cc1350/tx-power-driver.c rename to arch/platform/cc26x0-cc13x0/launchpad/cc1350/tx-power-driver.c diff --git a/arch/platform/srf06-cc26xx/launchpad/cc2640r2/Makefile.cc2640r2 b/arch/platform/cc26x0-cc13x0/launchpad/cc2640r2/Makefile.cc2640r2 similarity index 100% rename from arch/platform/srf06-cc26xx/launchpad/cc2640r2/Makefile.cc2640r2 rename to arch/platform/cc26x0-cc13x0/launchpad/cc2640r2/Makefile.cc2640r2 diff --git a/arch/platform/srf06-cc26xx/launchpad/cc2640r2/board.h b/arch/platform/cc26x0-cc13x0/launchpad/cc2640r2/board.h similarity index 100% rename from arch/platform/srf06-cc26xx/launchpad/cc2640r2/board.h rename to arch/platform/cc26x0-cc13x0/launchpad/cc2640r2/board.h diff --git a/arch/platform/srf06-cc26xx/launchpad/cc2650/Makefile.cc2650 b/arch/platform/cc26x0-cc13x0/launchpad/cc2650/Makefile.cc2650 similarity index 91% rename from arch/platform/srf06-cc26xx/launchpad/cc2650/Makefile.cc2650 rename to arch/platform/cc26x0-cc13x0/launchpad/cc2650/Makefile.cc2650 index 72e50de3a..399cd79e5 100644 --- a/arch/platform/srf06-cc26xx/launchpad/cc2650/Makefile.cc2650 +++ b/arch/platform/cc26x0-cc13x0/launchpad/cc2650/Makefile.cc2650 @@ -1,5 +1,5 @@ ### Will allow the inclusion of the correct CPU makefile -CPU_FAMILY = cc26xx +CPU_FAMILY = cc26x0 ### Add to the source dirs CONTIKI_TARGET_DIRS += launchpad/cc2650 diff --git a/arch/platform/srf06-cc26xx/launchpad/cc2650/board.h b/arch/platform/cc26x0-cc13x0/launchpad/cc2650/board.h similarity index 100% rename from arch/platform/srf06-cc26xx/launchpad/cc2650/board.h rename to arch/platform/cc26x0-cc13x0/launchpad/cc2650/board.h diff --git a/arch/platform/srf06-cc26xx/launchpad/leds-arch.c b/arch/platform/cc26x0-cc13x0/launchpad/leds-arch.c similarity index 100% rename from arch/platform/srf06-cc26xx/launchpad/leds-arch.c rename to arch/platform/cc26x0-cc13x0/launchpad/leds-arch.c diff --git a/arch/platform/srf06-cc26xx/platform.c b/arch/platform/cc26x0-cc13x0/platform.c similarity index 100% rename from arch/platform/srf06-cc26xx/platform.c rename to arch/platform/cc26x0-cc13x0/platform.c diff --git a/arch/platform/srf06-cc26xx/sensortag/Makefile.sensortag b/arch/platform/cc26x0-cc13x0/sensortag/Makefile.sensortag similarity index 100% rename from arch/platform/srf06-cc26xx/sensortag/Makefile.sensortag rename to arch/platform/cc26x0-cc13x0/sensortag/Makefile.sensortag diff --git a/arch/platform/srf06-cc26xx/sensortag/bmp-280-sensor.c b/arch/platform/cc26x0-cc13x0/sensortag/bmp-280-sensor.c similarity index 100% rename from arch/platform/srf06-cc26xx/sensortag/bmp-280-sensor.c rename to arch/platform/cc26x0-cc13x0/sensortag/bmp-280-sensor.c diff --git a/arch/platform/srf06-cc26xx/sensortag/bmp-280-sensor.h b/arch/platform/cc26x0-cc13x0/sensortag/bmp-280-sensor.h similarity index 100% rename from arch/platform/srf06-cc26xx/sensortag/bmp-280-sensor.h rename to arch/platform/cc26x0-cc13x0/sensortag/bmp-280-sensor.h diff --git a/arch/platform/srf06-cc26xx/sensortag/board-buttons.c b/arch/platform/cc26x0-cc13x0/sensortag/board-buttons.c similarity index 100% rename from arch/platform/srf06-cc26xx/sensortag/board-buttons.c rename to arch/platform/cc26x0-cc13x0/sensortag/board-buttons.c diff --git a/arch/platform/srf06-cc26xx/sensortag/board-i2c.c b/arch/platform/cc26x0-cc13x0/sensortag/board-i2c.c similarity index 100% rename from arch/platform/srf06-cc26xx/sensortag/board-i2c.c rename to arch/platform/cc26x0-cc13x0/sensortag/board-i2c.c diff --git a/arch/platform/srf06-cc26xx/sensortag/board-i2c.h b/arch/platform/cc26x0-cc13x0/sensortag/board-i2c.h similarity index 100% rename from arch/platform/srf06-cc26xx/sensortag/board-i2c.h rename to arch/platform/cc26x0-cc13x0/sensortag/board-i2c.h diff --git a/arch/platform/srf06-cc26xx/sensortag/board-peripherals.h b/arch/platform/cc26x0-cc13x0/sensortag/board-peripherals.h similarity index 100% rename from arch/platform/srf06-cc26xx/sensortag/board-peripherals.h rename to arch/platform/cc26x0-cc13x0/sensortag/board-peripherals.h diff --git a/arch/platform/srf06-cc26xx/sensortag/board.c b/arch/platform/cc26x0-cc13x0/sensortag/board.c similarity index 100% rename from arch/platform/srf06-cc26xx/sensortag/board.c rename to arch/platform/cc26x0-cc13x0/sensortag/board.c diff --git a/arch/platform/srf06-cc26xx/sensortag/buzzer.c b/arch/platform/cc26x0-cc13x0/sensortag/buzzer.c similarity index 100% rename from arch/platform/srf06-cc26xx/sensortag/buzzer.c rename to arch/platform/cc26x0-cc13x0/sensortag/buzzer.c diff --git a/arch/platform/srf06-cc26xx/sensortag/buzzer.h b/arch/platform/cc26x0-cc13x0/sensortag/buzzer.h similarity index 100% rename from arch/platform/srf06-cc26xx/sensortag/buzzer.h rename to arch/platform/cc26x0-cc13x0/sensortag/buzzer.h diff --git a/arch/platform/srf06-cc26xx/sensortag/cc1350/Makefile.cc1350 b/arch/platform/cc26x0-cc13x0/sensortag/cc1350/Makefile.cc1350 similarity index 91% rename from arch/platform/srf06-cc26xx/sensortag/cc1350/Makefile.cc1350 rename to arch/platform/cc26x0-cc13x0/sensortag/cc1350/Makefile.cc1350 index cdae4c2b1..f0f924e97 100644 --- a/arch/platform/srf06-cc26xx/sensortag/cc1350/Makefile.cc1350 +++ b/arch/platform/cc26x0-cc13x0/sensortag/cc1350/Makefile.cc1350 @@ -1,5 +1,5 @@ ### Will allow the inclusion of the correct CPU makefile -CPU_FAMILY = cc13xx +CPU_FAMILY = cc13x0 ### Add to the source dirs CONTIKI_TARGET_DIRS += sensortag/cc1350 diff --git a/arch/platform/srf06-cc26xx/sensortag/cc1350/board.h b/arch/platform/cc26x0-cc13x0/sensortag/cc1350/board.h similarity index 100% rename from arch/platform/srf06-cc26xx/sensortag/cc1350/board.h rename to arch/platform/cc26x0-cc13x0/sensortag/cc1350/board.h diff --git a/arch/platform/srf06-cc26xx/sensortag/cc1350/leds-arch.c b/arch/platform/cc26x0-cc13x0/sensortag/cc1350/leds-arch.c similarity index 100% rename from arch/platform/srf06-cc26xx/sensortag/cc1350/leds-arch.c rename to arch/platform/cc26x0-cc13x0/sensortag/cc1350/leds-arch.c diff --git a/arch/platform/srf06-cc26xx/sensortag/cc2650/Makefile.cc2650 b/arch/platform/cc26x0-cc13x0/sensortag/cc2650/Makefile.cc2650 similarity index 91% rename from arch/platform/srf06-cc26xx/sensortag/cc2650/Makefile.cc2650 rename to arch/platform/cc26x0-cc13x0/sensortag/cc2650/Makefile.cc2650 index e91cabda4..4aa83e352 100644 --- a/arch/platform/srf06-cc26xx/sensortag/cc2650/Makefile.cc2650 +++ b/arch/platform/cc26x0-cc13x0/sensortag/cc2650/Makefile.cc2650 @@ -1,5 +1,5 @@ ### Will allow the inclusion of the correct CPU makefile -CPU_FAMILY = cc26xx +CPU_FAMILY = cc26x0 ### Add to the source dirs CONTIKI_TARGET_DIRS += sensortag/cc2650 diff --git a/arch/platform/srf06-cc26xx/sensortag/cc2650/board.h b/arch/platform/cc26x0-cc13x0/sensortag/cc2650/board.h similarity index 100% rename from arch/platform/srf06-cc26xx/sensortag/cc2650/board.h rename to arch/platform/cc26x0-cc13x0/sensortag/cc2650/board.h diff --git a/arch/platform/srf06-cc26xx/sensortag/cc2650/leds-arch.c b/arch/platform/cc26x0-cc13x0/sensortag/cc2650/leds-arch.c similarity index 100% rename from arch/platform/srf06-cc26xx/sensortag/cc2650/leds-arch.c rename to arch/platform/cc26x0-cc13x0/sensortag/cc2650/leds-arch.c diff --git a/arch/platform/srf06-cc26xx/sensortag/hdc-1000-sensor.c b/arch/platform/cc26x0-cc13x0/sensortag/hdc-1000-sensor.c similarity index 100% rename from arch/platform/srf06-cc26xx/sensortag/hdc-1000-sensor.c rename to arch/platform/cc26x0-cc13x0/sensortag/hdc-1000-sensor.c diff --git a/arch/platform/srf06-cc26xx/sensortag/hdc-1000-sensor.h b/arch/platform/cc26x0-cc13x0/sensortag/hdc-1000-sensor.h similarity index 100% rename from arch/platform/srf06-cc26xx/sensortag/hdc-1000-sensor.h rename to arch/platform/cc26x0-cc13x0/sensortag/hdc-1000-sensor.h diff --git a/arch/platform/srf06-cc26xx/sensortag/mpu-9250-sensor.c b/arch/platform/cc26x0-cc13x0/sensortag/mpu-9250-sensor.c similarity index 100% rename from arch/platform/srf06-cc26xx/sensortag/mpu-9250-sensor.c rename to arch/platform/cc26x0-cc13x0/sensortag/mpu-9250-sensor.c diff --git a/arch/platform/srf06-cc26xx/sensortag/mpu-9250-sensor.h b/arch/platform/cc26x0-cc13x0/sensortag/mpu-9250-sensor.h similarity index 100% rename from arch/platform/srf06-cc26xx/sensortag/mpu-9250-sensor.h rename to arch/platform/cc26x0-cc13x0/sensortag/mpu-9250-sensor.h diff --git a/arch/platform/srf06-cc26xx/sensortag/opt-3001-sensor.c b/arch/platform/cc26x0-cc13x0/sensortag/opt-3001-sensor.c similarity index 100% rename from arch/platform/srf06-cc26xx/sensortag/opt-3001-sensor.c rename to arch/platform/cc26x0-cc13x0/sensortag/opt-3001-sensor.c diff --git a/arch/platform/srf06-cc26xx/sensortag/opt-3001-sensor.h b/arch/platform/cc26x0-cc13x0/sensortag/opt-3001-sensor.h similarity index 100% rename from arch/platform/srf06-cc26xx/sensortag/opt-3001-sensor.h rename to arch/platform/cc26x0-cc13x0/sensortag/opt-3001-sensor.h diff --git a/arch/platform/srf06-cc26xx/sensortag/sensor-common.c b/arch/platform/cc26x0-cc13x0/sensortag/sensor-common.c similarity index 100% rename from arch/platform/srf06-cc26xx/sensortag/sensor-common.c rename to arch/platform/cc26x0-cc13x0/sensortag/sensor-common.c diff --git a/arch/platform/srf06-cc26xx/sensortag/sensor-common.h b/arch/platform/cc26x0-cc13x0/sensortag/sensor-common.h similarity index 100% rename from arch/platform/srf06-cc26xx/sensortag/sensor-common.h rename to arch/platform/cc26x0-cc13x0/sensortag/sensor-common.h diff --git a/arch/platform/srf06-cc26xx/sensortag/sensortag-sensors.c b/arch/platform/cc26x0-cc13x0/sensortag/sensortag-sensors.c similarity index 100% rename from arch/platform/srf06-cc26xx/sensortag/sensortag-sensors.c rename to arch/platform/cc26x0-cc13x0/sensortag/sensortag-sensors.c diff --git a/arch/platform/srf06-cc26xx/sensortag/tmp-007-sensor.c b/arch/platform/cc26x0-cc13x0/sensortag/tmp-007-sensor.c similarity index 100% rename from arch/platform/srf06-cc26xx/sensortag/tmp-007-sensor.c rename to arch/platform/cc26x0-cc13x0/sensortag/tmp-007-sensor.c diff --git a/arch/platform/srf06-cc26xx/sensortag/tmp-007-sensor.h b/arch/platform/cc26x0-cc13x0/sensortag/tmp-007-sensor.h similarity index 100% rename from arch/platform/srf06-cc26xx/sensortag/tmp-007-sensor.h rename to arch/platform/cc26x0-cc13x0/sensortag/tmp-007-sensor.h diff --git a/arch/platform/srf06-cc26xx/srf06/Makefile.srf06 b/arch/platform/cc26x0-cc13x0/srf06/Makefile.srf06 similarity index 100% rename from arch/platform/srf06-cc26xx/srf06/Makefile.srf06 rename to arch/platform/cc26x0-cc13x0/srf06/Makefile.srf06 diff --git a/arch/platform/srf06-cc26xx/srf06/als-sensor.c b/arch/platform/cc26x0-cc13x0/srf06/als-sensor.c similarity index 100% rename from arch/platform/srf06-cc26xx/srf06/als-sensor.c rename to arch/platform/cc26x0-cc13x0/srf06/als-sensor.c diff --git a/arch/platform/srf06-cc26xx/srf06/als-sensor.h b/arch/platform/cc26x0-cc13x0/srf06/als-sensor.h similarity index 100% rename from arch/platform/srf06-cc26xx/srf06/als-sensor.h rename to arch/platform/cc26x0-cc13x0/srf06/als-sensor.h diff --git a/arch/platform/srf06-cc26xx/srf06/board-buttons.c b/arch/platform/cc26x0-cc13x0/srf06/board-buttons.c similarity index 100% rename from arch/platform/srf06-cc26xx/srf06/board-buttons.c rename to arch/platform/cc26x0-cc13x0/srf06/board-buttons.c diff --git a/arch/platform/srf06-cc26xx/srf06/board-peripherals.h b/arch/platform/cc26x0-cc13x0/srf06/board-peripherals.h similarity index 100% rename from arch/platform/srf06-cc26xx/srf06/board-peripherals.h rename to arch/platform/cc26x0-cc13x0/srf06/board-peripherals.h diff --git a/arch/platform/srf06-cc26xx/srf06/board.c b/arch/platform/cc26x0-cc13x0/srf06/board.c similarity index 100% rename from arch/platform/srf06-cc26xx/srf06/board.c rename to arch/platform/cc26x0-cc13x0/srf06/board.c diff --git a/arch/platform/srf06-cc26xx/srf06/cc13xx/Makefile.cc13xx b/arch/platform/cc26x0-cc13x0/srf06/cc13x0/Makefile.cc13x0 similarity index 72% rename from arch/platform/srf06-cc26xx/srf06/cc13xx/Makefile.cc13xx rename to arch/platform/cc26x0-cc13x0/srf06/cc13x0/Makefile.cc13x0 index b83084651..ec20fcb63 100644 --- a/arch/platform/srf06-cc26xx/srf06/cc13xx/Makefile.cc13xx +++ b/arch/platform/cc26x0-cc13x0/srf06/cc13x0/Makefile.cc13x0 @@ -1,7 +1,7 @@ ### Will allow the inclusion of the correct CPU makefile -CPU_FAMILY = cc13xx +CPU_FAMILY = cc13x0 ### Include the common sensortag makefile include $(PLATFORM_ROOT_DIR)/srf06/Makefile.srf06 -CONTIKI_TARGET_DIRS += srf06/cc13xx +CONTIKI_TARGET_DIRS += srf06/cc13x0 diff --git a/arch/platform/srf06-cc26xx/srf06/cc13xx/board.h b/arch/platform/cc26x0-cc13x0/srf06/cc13x0/board.h similarity index 100% rename from arch/platform/srf06-cc26xx/srf06/cc13xx/board.h rename to arch/platform/cc26x0-cc13x0/srf06/cc13x0/board.h diff --git a/arch/platform/srf06-cc26xx/srf06/cc26xx/Makefile.cc26xx b/arch/platform/cc26x0-cc13x0/srf06/cc26x0/Makefile.cc26x0 similarity index 71% rename from arch/platform/srf06-cc26xx/srf06/cc26xx/Makefile.cc26xx rename to arch/platform/cc26x0-cc13x0/srf06/cc26x0/Makefile.cc26x0 index 841442a5c..84ef217a8 100644 --- a/arch/platform/srf06-cc26xx/srf06/cc26xx/Makefile.cc26xx +++ b/arch/platform/cc26x0-cc13x0/srf06/cc26x0/Makefile.cc26x0 @@ -1,7 +1,7 @@ ### Will allow the inclusion of the correct CPU makefile -CPU_FAMILY = cc26xx +CPU_FAMILY = cc26x0 ### Include the common makefile include $(PLATFORM_ROOT_DIR)/srf06/Makefile.srf06 -CONTIKI_TARGET_DIRS += srf06/cc26xx +CONTIKI_TARGET_DIRS += srf06/cc26x0 diff --git a/arch/platform/srf06-cc26xx/srf06/cc26xx/board.h b/arch/platform/cc26x0-cc13x0/srf06/cc26x0/board.h similarity index 99% rename from arch/platform/srf06-cc26xx/srf06/cc26xx/board.h rename to arch/platform/cc26x0-cc13x0/srf06/cc26x0/board.h index f31a94fb3..cd6d2b1e4 100644 --- a/arch/platform/srf06-cc26xx/srf06/cc26xx/board.h +++ b/arch/platform/cc26x0-cc13x0/srf06/cc26x0/board.h @@ -31,7 +31,7 @@ /** \addtogroup cc26xx-srf-tag * @{ * - * \defgroup srf06-cc26xx-peripherals Peripherals for the SmartRF06EB + CC26xxEM + * \defgroup cc26x0-cc13x0-peripherals Peripherals for the SmartRF06EB + CC26xxEM * * Defines related to the SmartRF06 Evaluation Board with a CC26xxEM * diff --git a/arch/platform/srf06-cc26xx/srf06/leds-arch.c b/arch/platform/cc26x0-cc13x0/srf06/leds-arch.c similarity index 100% rename from arch/platform/srf06-cc26xx/srf06/leds-arch.c rename to arch/platform/cc26x0-cc13x0/srf06/leds-arch.c diff --git a/arch/platform/srf06-cc26xx/srf06/srf06-sensors.c b/arch/platform/cc26x0-cc13x0/srf06/srf06-sensors.c similarity index 100% rename from arch/platform/srf06-cc26xx/srf06/srf06-sensors.c rename to arch/platform/cc26x0-cc13x0/srf06/srf06-sensors.c diff --git a/arch/platform/nrf52dk/contiki-conf.h b/arch/platform/nrf52dk/contiki-conf.h index 7b3b66314..12d1b2fc9 100644 --- a/arch/platform/nrf52dk/contiki-conf.h +++ b/arch/platform/nrf52dk/contiki-conf.h @@ -74,6 +74,10 @@ /* Packet buffer */ #define PACKETBUF_CONF_SIZE 1280 /**< Required IPv6 MTU size */ + +/* Queuebuf */ +#define QUEUEBUF_CONF_ENABLED 0 + /** @} */ /** diff --git a/arch/platform/zoul/Makefile.zoul b/arch/platform/zoul/Makefile.zoul index 38b86fd13..938abe035 100644 --- a/arch/platform/zoul/Makefile.zoul +++ b/arch/platform/zoul/Makefile.zoul @@ -46,23 +46,8 @@ MODULES += arch/dev/cc1200 arch/dev/rgb-led os/storage/cfs BSL = $(CONTIKI)/tools/cc2538-bsl/cc2538-bsl.py -### Use the specific Zoul subplatform to query for connected devices -ifdef MOTELIST_ZOLERTIA - MOTELIST_FLAGS += -b $(MOTELIST_ZOLERTIA) -endif - -### Detect if a mote is connected over serial port -ifeq ($(HOST_OS),Darwin) - USBDEVPREFIX= - MOTELIST := $(CONTIKI)/tools/zolertia/motelist-zolertia-macos - MOTES := $(shell $(MOTELIST) -c 2>&- | cut -f 2 -d ,) -else -### If we are not running under Mac, we assume Linux - USBDEVPREFIX= - MOTELIST := $(CONTIKI)/tools/zolertia/motelist-zolertia - MOTES := $(shell $(MOTELIST) -b $(MOTELIST_ZOLERTIA) -c 2>&- | cut -f 2 -d , | \ - perl -ne 'print $$1 . " " if(m-(/dev/\w+)-);') -endif +MOTES := $(shell python $(TOOLS_DIR)/motelist/motelist.py --omit-header \ + | grep $(MOTELIST_ZOLERTIA) | cut -f1 -d " ") ### If PORT is defined, override to keep backward compatibility ifdef PORT @@ -81,7 +66,8 @@ endif ### Variable that expands into a pattern rule to upload to a given MOTE. ### Requires $(MOTE) to be defined -### $$$$ Double escapes $s that need to be passed to the shell - once for when make parses UPLOAD_RULE, and once for when the expanded rule is parsed by make. +### $$$$ Double escapes $s that need to be passed to the shell - once for when +### make parses UPLOAD_RULE, and once for when the expanded rule is parsed by make. define UPLOAD_RULE %.$(MOTE): %.bin %.elf @echo "Flashing $(MOTE)" @@ -94,10 +80,8 @@ endef ### Create an upload rule for every MOTE connected $(foreach MOTE,$(MOTES),$(eval $(UPLOAD_RULE))) -motelist: - $(MOTELIST) -zoul-motelist: - $(MOTELIST) $(MOTELIST_FLAGS) +.PHONY: zoul-motes + zoul-motes: @echo $(MOTES) diff --git a/arch/platform/zoul/firefly-reva/Makefile.firefly-reva b/arch/platform/zoul/firefly-reva/Makefile.firefly-reva index afecf9fa5..bfbcb03fb 100644 --- a/arch/platform/zoul/firefly-reva/Makefile.firefly-reva +++ b/arch/platform/zoul/firefly-reva/Makefile.firefly-reva @@ -1,2 +1,2 @@ -MOTELIST_ZOLERTIA = firefly +MOTELIST_ZOLERTIA := Firefly BOARD_SOURCEFILES += board.c diff --git a/arch/platform/zoul/firefly/Makefile.firefly b/arch/platform/zoul/firefly/Makefile.firefly index afecf9fa5..bfbcb03fb 100644 --- a/arch/platform/zoul/firefly/Makefile.firefly +++ b/arch/platform/zoul/firefly/Makefile.firefly @@ -1,2 +1,2 @@ -MOTELIST_ZOLERTIA = firefly +MOTELIST_ZOLERTIA := Firefly BOARD_SOURCEFILES += board.c diff --git a/arch/platform/zoul/orion/Makefile.orion b/arch/platform/zoul/orion/Makefile.orion index ebc1bdad4..b7313afc0 100644 --- a/arch/platform/zoul/orion/Makefile.orion +++ b/arch/platform/zoul/orion/Makefile.orion @@ -1,4 +1,4 @@ -MOTELIST_ZOLERTIA = orion +MOTELIST_ZOLERTIA := Orion MODULES += arch/dev/enc28j60 CC2538_ENC28J60_ARCH ?= gpio ifeq ($(WITH_IP64),1) diff --git a/arch/platform/zoul/remote-reva/Makefile.remote-reva b/arch/platform/zoul/remote-reva/Makefile.remote-reva index fcccdf0f4..ec4095265 100644 --- a/arch/platform/zoul/remote-reva/Makefile.remote-reva +++ b/arch/platform/zoul/remote-reva/Makefile.remote-reva @@ -1,4 +1,4 @@ -MOTELIST_ZOLERTIA = remote +MOTELIST_ZOLERTIA := RE-Mote BOARD_SOURCEFILES += board.c antenna-sw.c mmc-arch.c rtcc.c power-mgmt.c MODULES += os/lib/fs/fat os/lib/fs/fat/option arch/platform/zoul/fs/fat arch/dev/disk/mmc diff --git a/arch/platform/zoul/remote-revb/Makefile.remote-revb b/arch/platform/zoul/remote-revb/Makefile.remote-revb index fcccdf0f4..ec4095265 100644 --- a/arch/platform/zoul/remote-revb/Makefile.remote-revb +++ b/arch/platform/zoul/remote-revb/Makefile.remote-revb @@ -1,4 +1,4 @@ -MOTELIST_ZOLERTIA = remote +MOTELIST_ZOLERTIA := RE-Mote BOARD_SOURCEFILES += board.c antenna-sw.c mmc-arch.c rtcc.c power-mgmt.c MODULES += os/lib/fs/fat os/lib/fs/fat/option arch/platform/zoul/fs/fat arch/dev/disk/mmc diff --git a/examples/6tisch/channel-selection-demo/Makefile b/examples/6tisch/channel-selection-demo/Makefile index a44c76f10..ada4a5062 100644 --- a/examples/6tisch/channel-selection-demo/Makefile +++ b/examples/6tisch/channel-selection-demo/Makefile @@ -4,7 +4,7 @@ all: $(CONTIKI_PROJECT) CONTIKI=../../.. PLATFORMS_EXCLUDE = sky nrf52dk native -BOARDS_EXCLUDE = srf06/cc13xx launchpad/cc1310 launchpad/cc1350 sensortag/cc2650 sensortag/cc1350 +BOARDS_EXCLUDE = srf06/cc13x0 launchpad/cc1310 launchpad/cc1350 sensortag/cc2650 sensortag/cc1350 # The channel selection library MODULES += os/services/tsch-cs diff --git a/examples/6tisch/etsi-plugtest-2017/README.md b/examples/6tisch/etsi-plugtest-2017/README.md index ab296bff8..7369918fa 100644 --- a/examples/6tisch/etsi-plugtest-2017/README.md +++ b/examples/6tisch/etsi-plugtest-2017/README.md @@ -18,7 +18,7 @@ The following hardwares were used in the event: * Zolertia Remote (TARGET=`zoul`, BOARD=`remote`) * JN156x (TARGET=`jn516`) -* CC2650 LaunchPad (TARGET=`srf06-cc26xx`, BOARD=`launchpad/cc2650`) +* CC2650 LaunchPad (TARGET=`cc26x0-cc13x0`, BOARD=`launchpad/cc2650`) ## Usage diff --git a/examples/6tisch/tsch-stats/Makefile b/examples/6tisch/tsch-stats/Makefile index 0c8863301..5fdb5feb6 100644 --- a/examples/6tisch/tsch-stats/Makefile +++ b/examples/6tisch/tsch-stats/Makefile @@ -4,7 +4,7 @@ all: $(CONTIKI_PROJECT) CONTIKI=../../.. PLATFORMS_EXCLUDE = sky nrf52dk native -BOARDS_EXCLUDE = srf06/cc13xx launchpad/cc1310 launchpad/cc1350 sensortag/cc2650 sensortag/cc1350 +BOARDS_EXCLUDE = srf06/cc13x0 launchpad/cc1310 launchpad/cc1350 sensortag/cc2650 sensortag/cc1350 # force Orchestra from command line MAKE_WITH_ORCHESTRA ?= 0 diff --git a/examples/benchmarks/rpl-req-resp/Makefile b/examples/benchmarks/rpl-req-resp/Makefile index 11413ecd3..e23a35d5f 100644 --- a/examples/benchmarks/rpl-req-resp/Makefile +++ b/examples/benchmarks/rpl-req-resp/Makefile @@ -2,7 +2,7 @@ CONTIKI_PROJECT = node all: $(CONTIKI_PROJECT) PLATFORMS_EXCLUDE = sky nrf52dk native simplelink -BOARDS_EXCLUDE = srf06/cc13xx launchpad/cc1310 launchpad/cc1350 sensortag/cc2650 sensortag/cc1350 +BOARDS_EXCLUDE = srf06/cc13x0 launchpad/cc1310 launchpad/cc1350 sensortag/cc2650 sensortag/cc1350 MODULES_REL += ../testbeds MODULES += os/services/deployment diff --git a/examples/dev/button-hal/Makefile b/examples/dev/button-hal/Makefile index b2a73fe3c..263e9ec65 100644 --- a/examples/dev/button-hal/Makefile +++ b/examples/dev/button-hal/Makefile @@ -3,6 +3,6 @@ CONTIKI = ../../.. all: $(CONTIKI_PROJECT) -PLATFORMS_ONLY = srf06-cc26xx cc2538dk openmote-cc2538 zoul native simplelink +PLATFORMS_ONLY = cc26x0-cc13x0 cc2538dk openmote-cc2538 zoul native simplelink include $(CONTIKI)/Makefile.include diff --git a/examples/dev/gpio-hal/Makefile b/examples/dev/gpio-hal/Makefile index 70f38a11a..234388c09 100644 --- a/examples/dev/gpio-hal/Makefile +++ b/examples/dev/gpio-hal/Makefile @@ -1,7 +1,7 @@ CONTIKI_PROJECT = gpio-hal-example CONTIKI = ../../.. -PLATFORMS_ONLY = srf06-cc26xx cc2538dk openmote-cc2538 zoul native simplelink +PLATFORMS_ONLY = cc26x0-cc13x0 cc2538dk openmote-cc2538 zoul native simplelink include $(CONTIKI)/Makefile.identify-target diff --git a/examples/dev/gpio-hal/srf06-cc26xx/pins.c b/examples/dev/gpio-hal/cc26x0-cc13x0/pins.c similarity index 100% rename from examples/dev/gpio-hal/srf06-cc26xx/pins.c rename to examples/dev/gpio-hal/cc26x0-cc13x0/pins.c diff --git a/examples/dev/gpio-hal/gpio-hal-example.c b/examples/dev/gpio-hal/gpio-hal-example.c index 380c06388..75137e26a 100644 --- a/examples/dev/gpio-hal/gpio-hal-example.c +++ b/examples/dev/gpio-hal/gpio-hal-example.c @@ -46,9 +46,9 @@ static uint8_t counter; /*---------------------------------------------------------------------------*/ /* Print gpio_hal_pin_mask_t using the correct format */ #if GPIO_HAL_PIN_COUNT > 32 -#define PIN_MASK_FMT PRIx64 +#define PIN_MASK_FMT "0x%016" PRIx64 #else -#define PIN_MASK_FMT PRIx32 +#define PIN_MASK_FMT "0x%08" PRIx32 #endif /*---------------------------------------------------------------------------*/ PROCESS(gpio_hal_example, "GPIO HAL Example"); @@ -127,7 +127,7 @@ PROCESS_THREAD(gpio_hal_example, ev, data) } /* Test read */ - printf("%u: Pins are 1-%u, 2=%u, 3=%u, mask=0x%08" PIN_MASK_FMT "\n", + printf("%u: Pins are 1-%u, 2=%u, 3=%u, mask=" PIN_MASK_FMT "\n", counter & 7, gpio_hal_arch_read_pin(out_pin1), gpio_hal_arch_read_pin(out_pin2), diff --git a/examples/libs/timers/all-timers.c b/examples/libs/timers/all-timers.c index 2a1f27b28..bb6dfed90 100644 --- a/examples/libs/timers/all-timers.c +++ b/examples/libs/timers/all-timers.c @@ -79,7 +79,7 @@ PROCESS_THREAD(timer_process, ev, data) PROCESS_BEGIN(); ctimer_set(&timer_ctimer, CLOCK_SECOND, ctimer_callback, NULL); - rtimer_set(&timer_rtimer, RTIMER_NOW() + CLOCK_SECOND / 2, 0, + rtimer_set(&timer_rtimer, RTIMER_NOW() + RTIMER_SECOND / 2, 0, rtimer_callback, NULL); while(1) { diff --git a/examples/mqtt-client/Makefile b/examples/mqtt-client/Makefile index a9ab11613..29b3267e1 100644 --- a/examples/mqtt-client/Makefile +++ b/examples/mqtt-client/Makefile @@ -8,6 +8,6 @@ CONTIKI = ../.. MODULES_REL += arch/platform/$(TARGET) -PLATFORMS_ONLY = srf06-cc26xx cc2538dk openmote-cc2538 zoul native simplelink +PLATFORMS_ONLY = cc26x0-cc13x0 cc2538dk openmote-cc2538 zoul native simplelink include $(CONTIKI)/Makefile.include diff --git a/examples/mqtt-client/arch/cpu/cc26xx-cc13xx/builtin-sensors.c b/examples/mqtt-client/arch/cpu/cc26x0-cc13x0/builtin-sensors.c similarity index 100% rename from examples/mqtt-client/arch/cpu/cc26xx-cc13xx/builtin-sensors.c rename to examples/mqtt-client/arch/cpu/cc26x0-cc13x0/builtin-sensors.c diff --git a/examples/mqtt-client/arch/cpu/cc26xx-cc13xx/builtin-sensors.h b/examples/mqtt-client/arch/cpu/cc26x0-cc13x0/builtin-sensors.h similarity index 100% rename from examples/mqtt-client/arch/cpu/cc26xx-cc13xx/builtin-sensors.h rename to examples/mqtt-client/arch/cpu/cc26x0-cc13x0/builtin-sensors.h diff --git a/examples/mqtt-client/arch/platform/cc26x0-cc13x0/Makefile.cc26x0-cc13x0 b/examples/mqtt-client/arch/platform/cc26x0-cc13x0/Makefile.cc26x0-cc13x0 new file mode 100644 index 000000000..7c74123c6 --- /dev/null +++ b/examples/mqtt-client/arch/platform/cc26x0-cc13x0/Makefile.cc26x0-cc13x0 @@ -0,0 +1 @@ +MODULES_REL += arch/cpu/cc26x0-cc13x0 diff --git a/examples/mqtt-client/arch/platform/srf06-cc26xx/module-macros.h b/examples/mqtt-client/arch/platform/cc26x0-cc13x0/module-macros.h similarity index 100% rename from examples/mqtt-client/arch/platform/srf06-cc26xx/module-macros.h rename to examples/mqtt-client/arch/platform/cc26x0-cc13x0/module-macros.h diff --git a/examples/mqtt-client/arch/platform/srf06-cc26xx/mqtt-client-extensions.c b/examples/mqtt-client/arch/platform/cc26x0-cc13x0/mqtt-client-extensions.c similarity index 100% rename from examples/mqtt-client/arch/platform/srf06-cc26xx/mqtt-client-extensions.c rename to examples/mqtt-client/arch/platform/cc26x0-cc13x0/mqtt-client-extensions.c diff --git a/examples/mqtt-client/arch/platform/srf06-cc26xx/Makefile.srf06-cc26xx b/examples/mqtt-client/arch/platform/srf06-cc26xx/Makefile.srf06-cc26xx deleted file mode 100644 index dcec87bad..000000000 --- a/examples/mqtt-client/arch/platform/srf06-cc26xx/Makefile.srf06-cc26xx +++ /dev/null @@ -1 +0,0 @@ -MODULES_REL += arch/cpu/cc26xx-cc13xx diff --git a/examples/mqtt-client/mqtt-client.c b/examples/mqtt-client/mqtt-client.c index be3c97cdb..b71a193ea 100644 --- a/examples/mqtt-client/mqtt-client.c +++ b/examples/mqtt-client/mqtt-client.c @@ -47,7 +47,11 @@ #include /*---------------------------------------------------------------------------*/ #define LOG_MODULE "mqtt-client" +#ifdef MQTT_CLIENT_CONF_LOG_LEVEL +#define LOG_LEVEL MQTT_CLIENT_CONF_LOG_LEVEL +#else #define LOG_LEVEL LOG_LEVEL_NONE +#endif /*---------------------------------------------------------------------------*/ /* Controls whether the example will work in IBM Watson IoT platform mode */ #ifdef MQTT_CLIENT_CONF_WITH_IBM_WATSON @@ -305,6 +309,7 @@ pub_handler(const char *topic, uint16_t topic_len, const uint8_t *chunk, } if(strncmp(&topic[10], "leds", 4) == 0) { + LOG_DBG("Received MQTT SUB\n"); if(chunk[0] == '1') { leds_on(LEDS_RED); } else if(chunk[0] == '0') { diff --git a/examples/mqtt-client/project-conf.h b/examples/mqtt-client/project-conf.h index 66ba909ce..6b011f7b0 100644 --- a/examples/mqtt-client/project-conf.h +++ b/examples/mqtt-client/project-conf.h @@ -52,7 +52,9 @@ * devices, set your Org ID here and then make sure you set the correct token * through MQTT_CLIENT_CONF_AUTH_TOKEN. */ +#ifndef MQTT_CLIENT_CONF_ORG_ID #define MQTT_CLIENT_CONF_ORG_ID "quickstart" +#endif /* * The MQTT username. diff --git a/examples/multicast/srf06-cc26xx/module-macros.h b/examples/multicast/cc26x0-cc13x0/module-macros.h similarity index 100% rename from examples/multicast/srf06-cc26xx/module-macros.h rename to examples/multicast/cc26x0-cc13x0/module-macros.h diff --git a/examples/platform-specific/cc26xx/Makefile b/examples/platform-specific/cc26x0-cc13x0/Makefile similarity index 78% rename from examples/platform-specific/cc26xx/Makefile rename to examples/platform-specific/cc26x0-cc13x0/Makefile index 40e484bcc..9962ab32a 100644 --- a/examples/platform-specific/cc26xx/Makefile +++ b/examples/platform-specific/cc26x0-cc13x0/Makefile @@ -1,6 +1,6 @@ CONTIKI_PROJECT = cc26xx-demo -PLATFORMS_ONLY = srf06-cc26xx +PLATFORMS_ONLY = cc26x0-cc13x0 all: $(CONTIKI_PROJECT) diff --git a/examples/platform-specific/cc26xx/Makefile.target b/examples/platform-specific/cc26x0-cc13x0/Makefile.target similarity index 100% rename from examples/platform-specific/cc26xx/Makefile.target rename to examples/platform-specific/cc26x0-cc13x0/Makefile.target diff --git a/examples/platform-specific/cc26xx/README.md b/examples/platform-specific/cc26x0-cc13x0/README.md similarity index 100% rename from examples/platform-specific/cc26xx/README.md rename to examples/platform-specific/cc26x0-cc13x0/README.md diff --git a/examples/platform-specific/cc26x0-cc13x0/ble-ipv6/Makefile b/examples/platform-specific/cc26x0-cc13x0/ble-ipv6/Makefile new file mode 100644 index 000000000..052927896 --- /dev/null +++ b/examples/platform-specific/cc26x0-cc13x0/ble-ipv6/Makefile @@ -0,0 +1,11 @@ +CONTIKI_PROJECT=client + +all: $(CONTIKI_PROJECT) + +PLATFORMS_ONLY = cc26x0-cc13x0 +BOARDS_ONLY = launchpad/cc2650 sensortag/cc2650 srf06/cc26x0 + +MAKE_MAC = MAKE_MAC_BLE +MAKE_NET = MAKE_NET_IPV6 +CONTIKI = ../../../.. +include $(CONTIKI)/Makefile.include diff --git a/examples/platform-specific/cc26xx/ble-ipv6/README.md b/examples/platform-specific/cc26x0-cc13x0/ble-ipv6/README.md similarity index 95% rename from examples/platform-specific/cc26xx/ble-ipv6/README.md rename to examples/platform-specific/cc26x0-cc13x0/ble-ipv6/README.md index d33c7329f..078667264 100644 --- a/examples/platform-specific/cc26xx/ble-ipv6/README.md +++ b/examples/platform-specific/cc26x0-cc13x0/ble-ipv6/README.md @@ -28,12 +28,12 @@ It has been tested on the TI CC2650 SensorTag and the TI CC2650 LaunchPad hardwa The IPv6-over-BLE stack comes with the following modules: ### BLE radio -The implementation of the BLE radio for the TI CC26xx platform is implemented in `arch/cpu/cc26xx-cc13xx/rf-core/ble-cc2650.c` -and `arch/cpu/cc26xx-cc13xx/rf-core/ble-hal/*.[ch]`. +The implementation of the BLE radio for the TI CC26xx platform is implemented in `arch/cpu/cc26x0-cc13x0/rf-core/ble-cc2650.c` +and `arch/cpu/cc26x0-cc13x0/rf-core/ble-hal/*.[ch]`. These files contain all the hardware specific code for supporting BLE as a link layer. ### BLE L2CAP layer -The L2CAP LE credit-based flow control support is implemented in `arch/cpu/cc26xx-cc13xx/rf-core/ble-l2cap.c`. +The L2CAP LE credit-based flow control support is implemented in `arch/cpu/cc26x0-cc13x0/rf-core/ble-l2cap.c`. Besides implementing rudimentary L2CAP support, this module handles fragmentation of large IPv6 packets. ## Using BLEach diff --git a/examples/platform-specific/cc26xx/ble-ipv6/client.c b/examples/platform-specific/cc26x0-cc13x0/ble-ipv6/client.c similarity index 100% rename from examples/platform-specific/cc26xx/ble-ipv6/client.c rename to examples/platform-specific/cc26x0-cc13x0/ble-ipv6/client.c diff --git a/examples/platform-specific/cc26xx/ble-ipv6/project-conf.h b/examples/platform-specific/cc26x0-cc13x0/ble-ipv6/project-conf.h similarity index 100% rename from examples/platform-specific/cc26xx/ble-ipv6/project-conf.h rename to examples/platform-specific/cc26x0-cc13x0/ble-ipv6/project-conf.h diff --git a/examples/platform-specific/cc26xx/cc26xx-demo.c b/examples/platform-specific/cc26x0-cc13x0/cc26x0-demo.c similarity index 99% rename from examples/platform-specific/cc26xx/cc26xx-demo.c rename to examples/platform-specific/cc26x0-cc13x0/cc26x0-demo.c index 81e99f3fa..1b71feeb7 100644 --- a/examples/platform-specific/cc26xx/cc26xx-demo.c +++ b/examples/platform-specific/cc26x0-cc13x0/cc26x0-demo.c @@ -42,7 +42,7 @@ * Example project demonstrating the CC13xx/CC26xx platforms * * This example will work for the following boards: - * - srf06-cc26xx: SmartRF06EB + CC13xx/CC26xx EM + * - cc26x0-cc13x0: SmartRF06EB + CC13xx/CC26xx EM * - CC2650 and CC1350 SensorTag * - CC1310, CC1350, CC2650 LaunchPads * diff --git a/examples/platform-specific/cc26xx/cc26xx-web-demo/Makefile b/examples/platform-specific/cc26x0-cc13x0/cc26x0-web-demo/Makefile similarity index 87% rename from examples/platform-specific/cc26xx/cc26xx-web-demo/Makefile rename to examples/platform-specific/cc26x0-cc13x0/cc26x0-web-demo/Makefile index 05dbface1..6d70a3a24 100644 --- a/examples/platform-specific/cc26xx/cc26xx-web-demo/Makefile +++ b/examples/platform-specific/cc26x0-cc13x0/cc26x0-web-demo/Makefile @@ -1,7 +1,7 @@ -CONTIKI_PROJECT = cc26xx-web-demo +CONTIKI_PROJECT = cc26x0-web-demo all: $(CONTIKI_PROJECT) -PLATFORMS_ONLY = srf06-cc26xx +PLATFORMS_ONLY = cc26x0-cc13x0 MODULES_REL += ./resources diff --git a/examples/platform-specific/cc26xx/cc26xx-web-demo/Makefile.target b/examples/platform-specific/cc26x0-cc13x0/cc26x0-web-demo/Makefile.target similarity index 100% rename from examples/platform-specific/cc26xx/cc26xx-web-demo/Makefile.target rename to examples/platform-specific/cc26x0-cc13x0/cc26x0-web-demo/Makefile.target diff --git a/examples/platform-specific/cc26xx/cc26xx-web-demo/README.md b/examples/platform-specific/cc26x0-cc13x0/cc26x0-web-demo/README.md similarity index 99% rename from examples/platform-specific/cc26xx/cc26xx-web-demo/README.md rename to examples/platform-specific/cc26x0-cc13x0/cc26x0-web-demo/README.md index 912fcb72a..6a85ee0b5 100644 --- a/examples/platform-specific/cc26xx/cc26xx-web-demo/README.md +++ b/examples/platform-specific/cc26x0-cc13x0/cc26x0-web-demo/README.md @@ -180,6 +180,6 @@ parser into the firmware. IBM Watson IoT Platform ---------------------------- -To use IBM Watson IoT Platform, you have to go to SECURITY tab of Device page to select "TLS Optional". This step is critical. If you don't do this, you need to use TLS for connection and default cc26xx-web-demo won't work. +To use IBM Watson IoT Platform, you have to go to SECURITY tab of Device page to select "TLS Optional". This step is critical. If you don't do this, you need to use TLS for connection and default cc26x0-web-demo won't work. ![IBM Watson IoT Platform TLS Optional Configuration](img/ibm-watson-iot-platform-tls-optional.png) diff --git a/examples/platform-specific/cc26xx/cc26xx-web-demo/cc26xx-web-demo.c b/examples/platform-specific/cc26x0-cc13x0/cc26x0-web-demo/cc26x0-web-demo.c similarity index 99% rename from examples/platform-specific/cc26xx/cc26xx-web-demo/cc26xx-web-demo.c rename to examples/platform-specific/cc26x0-cc13x0/cc26x0-web-demo/cc26x0-web-demo.c index 3944a58b2..6333d5ad5 100644 --- a/examples/platform-specific/cc26xx/cc26xx-web-demo/cc26xx-web-demo.c +++ b/examples/platform-specific/cc26x0-cc13x0/cc26x0-web-demo/cc26x0-web-demo.c @@ -28,7 +28,7 @@ * OF THE POSSIBILITY OF SUCH DAMAGE. */ /** - * \addtogroup cc26xx-web-demo + * \addtogroup cc26x0-web-demo * @{ * * \file @@ -48,7 +48,7 @@ #include "dev/button-hal.h" #include "batmon-sensor.h" #include "httpd-simple.h" -#include "cc26xx-web-demo.h" +#include "cc26x0-web-demo.h" #include "mqtt-client.h" #include "coap-server.h" diff --git a/examples/platform-specific/cc26xx/cc26xx-web-demo/cc26xx-web-demo.h b/examples/platform-specific/cc26x0-cc13x0/cc26x0-web-demo/cc26x0-web-demo.h similarity index 99% rename from examples/platform-specific/cc26xx/cc26xx-web-demo/cc26xx-web-demo.h rename to examples/platform-specific/cc26x0-cc13x0/cc26x0-web-demo/cc26x0-web-demo.h index f59e41bc7..e7252496c 100644 --- a/examples/platform-specific/cc26xx/cc26xx-web-demo/cc26xx-web-demo.h +++ b/examples/platform-specific/cc26x0-cc13x0/cc26x0-web-demo/cc26x0-web-demo.h @@ -31,7 +31,7 @@ * \addtogroup cc26xx-examples * @{ * - * \defgroup cc26xx-web-demo CC26xx Web Demo + * \defgroup cc26x0-web-demo CC26xx Web Demo * @{ * * An example demonstrating: diff --git a/examples/platform-specific/cc26xx/cc26xx-web-demo/cetic-6lbr-client.c b/examples/platform-specific/cc26x0-cc13x0/cc26x0-web-demo/cetic-6lbr-client.c similarity index 99% rename from examples/platform-specific/cc26xx/cc26xx-web-demo/cetic-6lbr-client.c rename to examples/platform-specific/cc26x0-cc13x0/cc26x0-web-demo/cetic-6lbr-client.c index 569a36a89..fc8044380 100644 --- a/examples/platform-specific/cc26xx/cc26xx-web-demo/cetic-6lbr-client.c +++ b/examples/platform-specific/cc26x0-cc13x0/cc26x0-web-demo/cetic-6lbr-client.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. */ /** - * \addtogroup cc26xx-web-demo + * \addtogroup cc26x0-web-demo * @{ * * \file diff --git a/examples/platform-specific/cc26xx/cc26xx-web-demo/coap-server.c b/examples/platform-specific/cc26x0-cc13x0/cc26x0-web-demo/coap-server.c similarity index 99% rename from examples/platform-specific/cc26xx/cc26xx-web-demo/coap-server.c rename to examples/platform-specific/cc26x0-cc13x0/cc26x0-web-demo/coap-server.c index 37b9a295d..bda7eb8ff 100644 --- a/examples/platform-specific/cc26xx/cc26xx-web-demo/coap-server.c +++ b/examples/platform-specific/cc26x0-cc13x0/cc26x0-web-demo/coap-server.c @@ -28,7 +28,7 @@ * OF THE POSSIBILITY OF SUCH DAMAGE. */ /** - * \addtogroup cc26xx-web-demo + * \addtogroup cc26x0-web-demo * @{ * * \file @@ -40,7 +40,7 @@ #include "coap-engine.h" #include "board-peripherals.h" #include "rf-core/rf-ble.h" -#include "cc26xx-web-demo.h" +#include "cc26x0-web-demo.h" #include #include diff --git a/examples/platform-specific/cc26xx/cc26xx-web-demo/coap-server.h b/examples/platform-specific/cc26x0-cc13x0/cc26x0-web-demo/coap-server.h similarity index 98% rename from examples/platform-specific/cc26xx/cc26xx-web-demo/coap-server.h rename to examples/platform-specific/cc26x0-cc13x0/cc26x0-web-demo/coap-server.h index 7399597c8..0d8c1d40b 100644 --- a/examples/platform-specific/cc26xx/cc26xx-web-demo/coap-server.h +++ b/examples/platform-specific/cc26x0-cc13x0/cc26x0-web-demo/coap-server.h @@ -28,7 +28,7 @@ * OF THE POSSIBILITY OF SUCH DAMAGE. */ /** - * \addtogroup cc26xx-web-demo + * \addtogroup cc26x0-web-demo * @{ * * \file diff --git a/examples/platform-specific/cc26xx/cc26xx-web-demo/httpd-simple.c b/examples/platform-specific/cc26x0-cc13x0/cc26x0-web-demo/httpd-simple.c similarity index 99% rename from examples/platform-specific/cc26xx/cc26xx-web-demo/httpd-simple.c rename to examples/platform-specific/cc26x0-cc13x0/cc26x0-web-demo/httpd-simple.c index e23e78efe..101b6441b 100644 --- a/examples/platform-specific/cc26xx/cc26xx-web-demo/httpd-simple.c +++ b/examples/platform-specific/cc26x0-cc13x0/cc26x0-web-demo/httpd-simple.c @@ -29,7 +29,7 @@ * */ /** - * \addtogroup cc26xx-web-demo + * \addtogroup cc26x0-web-demo * @{ * * \file @@ -38,11 +38,12 @@ /*---------------------------------------------------------------------------*/ #include "contiki.h" #include "httpd-simple.h" +#include "net/ipv6/uip-ds6-nbr.h" #include "net/ipv6/uip-ds6-route.h" #include "batmon-sensor.h" #include "lib/sensors.h" #include "lib/list.h" -#include "cc26xx-web-demo.h" +#include "cc26x0-web-demo.h" #include "mqtt-client.h" #include "net-uart.h" @@ -436,8 +437,8 @@ PT_THREAD(generate_index(struct httpd_state *s)) PT_WAIT_THREAD(&s->generate_pt, enqueue_chunk(s, 0, SECTION_OPEN "Neighbors" CONTENT_OPEN)); - for(s->nbr = nbr_table_head(ds6_neighbors); s->nbr != NULL; - s->nbr = nbr_table_next(ds6_neighbors, s->nbr)) { + for(s->nbr = uip_ds6_nbr_head(); s->nbr != NULL; + s->nbr = uip_ds6_nbr_next(s->nbr)) { PT_WAIT_THREAD(&s->generate_pt, enqueue_chunk(s, 0, "\n")); diff --git a/examples/platform-specific/cc26xx/cc26xx-web-demo/httpd-simple.h b/examples/platform-specific/cc26x0-cc13x0/cc26x0-web-demo/httpd-simple.h similarity index 99% rename from examples/platform-specific/cc26xx/cc26xx-web-demo/httpd-simple.h rename to examples/platform-specific/cc26x0-cc13x0/cc26x0-web-demo/httpd-simple.h index 25b8db3e5..2b04b264c 100644 --- a/examples/platform-specific/cc26xx/cc26xx-web-demo/httpd-simple.h +++ b/examples/platform-specific/cc26x0-cc13x0/cc26x0-web-demo/httpd-simple.h @@ -44,7 +44,7 @@ /*---------------------------------------------------------------------------*/ #include "contiki-net.h" #include "sys/process.h" -#include "cc26xx-web-demo.h" +#include "cc26x0-web-demo.h" /*---------------------------------------------------------------------------*/ /* Ideally a multiple of TCP_MSS */ #ifdef HTTPD_SIMPLE_CONF_MAIN_BUF_SIZE diff --git a/examples/platform-specific/cc26xx/cc26xx-web-demo/img/6lbr-web.png b/examples/platform-specific/cc26x0-cc13x0/cc26x0-web-demo/img/6lbr-web.png similarity index 100% rename from examples/platform-specific/cc26xx/cc26xx-web-demo/img/6lbr-web.png rename to examples/platform-specific/cc26x0-cc13x0/cc26x0-web-demo/img/6lbr-web.png diff --git a/examples/platform-specific/cc26xx/cc26xx-web-demo/img/ibm-watson-iot-platform-tls-optional.png b/examples/platform-specific/cc26x0-cc13x0/cc26x0-web-demo/img/ibm-watson-iot-platform-tls-optional.png similarity index 100% rename from examples/platform-specific/cc26xx/cc26xx-web-demo/img/ibm-watson-iot-platform-tls-optional.png rename to examples/platform-specific/cc26x0-cc13x0/cc26x0-web-demo/img/ibm-watson-iot-platform-tls-optional.png diff --git a/examples/platform-specific/cc26xx/cc26xx-web-demo/img/quickstart-sensortag.png b/examples/platform-specific/cc26x0-cc13x0/cc26x0-web-demo/img/quickstart-sensortag.png similarity index 100% rename from examples/platform-specific/cc26xx/cc26xx-web-demo/img/quickstart-sensortag.png rename to examples/platform-specific/cc26x0-cc13x0/cc26x0-web-demo/img/quickstart-sensortag.png diff --git a/examples/platform-specific/cc26xx/cc26xx-web-demo/img/sensor-readings-config.png b/examples/platform-specific/cc26x0-cc13x0/cc26x0-web-demo/img/sensor-readings-config.png similarity index 100% rename from examples/platform-specific/cc26xx/cc26xx-web-demo/img/sensor-readings-config.png rename to examples/platform-specific/cc26x0-cc13x0/cc26x0-web-demo/img/sensor-readings-config.png diff --git a/examples/platform-specific/cc26xx/cc26xx-web-demo/img/well-known-core.png b/examples/platform-specific/cc26x0-cc13x0/cc26x0-web-demo/img/well-known-core.png similarity index 100% rename from examples/platform-specific/cc26xx/cc26xx-web-demo/img/well-known-core.png rename to examples/platform-specific/cc26x0-cc13x0/cc26x0-web-demo/img/well-known-core.png diff --git a/examples/platform-specific/cc26xx/cc26xx-web-demo/mqtt-client.c b/examples/platform-specific/cc26x0-cc13x0/cc26x0-web-demo/mqtt-client.c similarity index 99% rename from examples/platform-specific/cc26xx/cc26xx-web-demo/mqtt-client.c rename to examples/platform-specific/cc26x0-cc13x0/cc26x0-web-demo/mqtt-client.c index 7562fb89a..0250de322 100644 --- a/examples/platform-specific/cc26xx/cc26xx-web-demo/mqtt-client.c +++ b/examples/platform-specific/cc26x0-cc13x0/cc26x0-web-demo/mqtt-client.c @@ -28,7 +28,7 @@ * OF THE POSSIBILITY OF SUCH DAMAGE. */ /** - * \addtogroup cc26xx-web-demo + * \addtogroup cc26x0-web-demo * @{ * * \file @@ -45,7 +45,7 @@ #include "lib/sensors.h" #include "dev/button-hal.h" #include "board-peripherals.h" -#include "cc26xx-web-demo.h" +#include "cc26x0-web-demo.h" #include "dev/leds.h" #include "mqtt-client.h" #include "httpd-simple.h" diff --git a/examples/platform-specific/cc26xx/cc26xx-web-demo/mqtt-client.h b/examples/platform-specific/cc26x0-cc13x0/cc26x0-web-demo/mqtt-client.h similarity index 99% rename from examples/platform-specific/cc26xx/cc26xx-web-demo/mqtt-client.h rename to examples/platform-specific/cc26x0-cc13x0/cc26x0-web-demo/mqtt-client.h index ab7c08227..68b26af6d 100644 --- a/examples/platform-specific/cc26xx/cc26xx-web-demo/mqtt-client.h +++ b/examples/platform-specific/cc26x0-cc13x0/cc26x0-web-demo/mqtt-client.h @@ -28,7 +28,7 @@ * OF THE POSSIBILITY OF SUCH DAMAGE. */ /** - * \addtogroup cc26xx-web-demo + * \addtogroup cc26x0-web-demo * @{ * * \file diff --git a/examples/platform-specific/cc26xx/cc26xx-web-demo/net-uart.c b/examples/platform-specific/cc26x0-cc13x0/cc26x0-web-demo/net-uart.c similarity index 99% rename from examples/platform-specific/cc26xx/cc26xx-web-demo/net-uart.c rename to examples/platform-specific/cc26x0-cc13x0/cc26x0-web-demo/net-uart.c index ca3bf8c82..a2ea899da 100644 --- a/examples/platform-specific/cc26xx/cc26xx-web-demo/net-uart.c +++ b/examples/platform-specific/cc26x0-cc13x0/cc26x0-web-demo/net-uart.c @@ -28,7 +28,7 @@ * OF THE POSSIBILITY OF SUCH DAMAGE. */ /** - * \addtogroup cc26xx-web-demo + * \addtogroup cc26x0-web-demo * @{ * * \file diff --git a/examples/platform-specific/cc26xx/cc26xx-web-demo/net-uart.h b/examples/platform-specific/cc26x0-cc13x0/cc26x0-web-demo/net-uart.h similarity index 100% rename from examples/platform-specific/cc26xx/cc26xx-web-demo/net-uart.h rename to examples/platform-specific/cc26x0-cc13x0/cc26x0-web-demo/net-uart.h diff --git a/examples/platform-specific/cc26xx/cc26xx-web-demo/project-conf.h b/examples/platform-specific/cc26x0-cc13x0/cc26x0-web-demo/project-conf.h similarity index 100% rename from examples/platform-specific/cc26xx/cc26xx-web-demo/project-conf.h rename to examples/platform-specific/cc26x0-cc13x0/cc26x0-web-demo/project-conf.h diff --git a/examples/platform-specific/cc26xx/cc26xx-web-demo/resources/res-ble-advd.c b/examples/platform-specific/cc26x0-cc13x0/cc26x0-web-demo/resources/res-ble-advd.c similarity index 99% rename from examples/platform-specific/cc26xx/cc26xx-web-demo/resources/res-ble-advd.c rename to examples/platform-specific/cc26x0-cc13x0/cc26x0-web-demo/resources/res-ble-advd.c index a94a0b7a0..b32cb82ec 100644 --- a/examples/platform-specific/cc26xx/cc26xx-web-demo/resources/res-ble-advd.c +++ b/examples/platform-specific/cc26x0-cc13x0/cc26x0-web-demo/resources/res-ble-advd.c @@ -28,7 +28,7 @@ */ /*---------------------------------------------------------------------------*/ /** - * \addtogroup cc26xx-web-demo + * \addtogroup cc26x0-web-demo * @{ * * \file diff --git a/examples/platform-specific/cc26xx/cc26xx-web-demo/resources/res-device.c b/examples/platform-specific/cc26x0-cc13x0/cc26x0-web-demo/resources/res-device.c similarity index 99% rename from examples/platform-specific/cc26xx/cc26xx-web-demo/resources/res-device.c rename to examples/platform-specific/cc26x0-cc13x0/cc26x0-web-demo/resources/res-device.c index 46344d1ef..bc61b8510 100644 --- a/examples/platform-specific/cc26xx/cc26xx-web-demo/resources/res-device.c +++ b/examples/platform-specific/cc26x0-cc13x0/cc26x0-web-demo/resources/res-device.c @@ -29,7 +29,7 @@ */ /*---------------------------------------------------------------------------*/ /** - * \addtogroup cc26xx-web-demo + * \addtogroup cc26x0-web-demo * @{ * * \file @@ -41,7 +41,7 @@ #include "coap.h" #include "sys/clock.h" #include "coap-server.h" -#include "cc26xx-web-demo.h" +#include "cc26x0-web-demo.h" #include "ti-lib.h" diff --git a/examples/platform-specific/cc26xx/cc26xx-web-demo/resources/res-leds.c b/examples/platform-specific/cc26x0-cc13x0/cc26x0-web-demo/resources/res-leds.c similarity index 99% rename from examples/platform-specific/cc26xx/cc26xx-web-demo/resources/res-leds.c rename to examples/platform-specific/cc26x0-cc13x0/cc26x0-web-demo/resources/res-leds.c index 6c396145c..538ecc0bd 100644 --- a/examples/platform-specific/cc26xx/cc26xx-web-demo/resources/res-leds.c +++ b/examples/platform-specific/cc26x0-cc13x0/cc26x0-web-demo/resources/res-leds.c @@ -29,7 +29,7 @@ */ /*---------------------------------------------------------------------------*/ /** - * \addtogroup cc26xx-web-demo + * \addtogroup cc26x0-web-demo * @{ * * \file diff --git a/examples/platform-specific/cc26xx/cc26xx-web-demo/resources/res-net.c b/examples/platform-specific/cc26x0-cc13x0/cc26x0-web-demo/resources/res-net.c similarity index 98% rename from examples/platform-specific/cc26xx/cc26xx-web-demo/resources/res-net.c rename to examples/platform-specific/cc26x0-cc13x0/cc26x0-web-demo/resources/res-net.c index 81575f345..43a4da354 100644 --- a/examples/platform-specific/cc26xx/cc26xx-web-demo/resources/res-net.c +++ b/examples/platform-specific/cc26x0-cc13x0/cc26x0-web-demo/resources/res-net.c @@ -29,7 +29,7 @@ */ /*---------------------------------------------------------------------------*/ /** - * \addtogroup cc26xx-web-demo + * \addtogroup cc26x0-web-demo * @{ * * \file @@ -41,7 +41,7 @@ #include "coap.h" #include "net/ipv6/uip-ds6.h" #include "coap-server.h" -#include "cc26xx-web-demo.h" +#include "cc26x0-web-demo.h" #include "ti-lib.h" diff --git a/examples/platform-specific/cc26xx/cc26xx-web-demo/resources/res-sensors.c b/examples/platform-specific/cc26x0-cc13x0/cc26x0-web-demo/resources/res-sensors.c similarity index 99% rename from examples/platform-specific/cc26xx/cc26xx-web-demo/resources/res-sensors.c rename to examples/platform-specific/cc26x0-cc13x0/cc26x0-web-demo/resources/res-sensors.c index 9ccc79e97..1852f7cb6 100644 --- a/examples/platform-specific/cc26xx/cc26xx-web-demo/resources/res-sensors.c +++ b/examples/platform-specific/cc26x0-cc13x0/cc26x0-web-demo/resources/res-sensors.c @@ -29,7 +29,7 @@ */ /*---------------------------------------------------------------------------*/ /** - * \addtogroup cc26xx-web-demo + * \addtogroup cc26x0-web-demo * @{ * * \file @@ -39,7 +39,7 @@ #include "contiki.h" #include "coap-engine.h" #include "coap.h" -#include "cc26xx-web-demo.h" +#include "cc26x0-web-demo.h" #include "coap-server.h" #include diff --git a/examples/platform-specific/cc26xx/cc26xx-web-demo/resources/res-toggle-leds.c b/examples/platform-specific/cc26x0-cc13x0/cc26x0-web-demo/resources/res-toggle-leds.c similarity index 99% rename from examples/platform-specific/cc26xx/cc26xx-web-demo/resources/res-toggle-leds.c rename to examples/platform-specific/cc26x0-cc13x0/cc26x0-web-demo/resources/res-toggle-leds.c index 1c708b539..00e632cef 100644 --- a/examples/platform-specific/cc26xx/cc26xx-web-demo/resources/res-toggle-leds.c +++ b/examples/platform-specific/cc26x0-cc13x0/cc26x0-web-demo/resources/res-toggle-leds.c @@ -31,7 +31,7 @@ */ /*---------------------------------------------------------------------------*/ /** - * \addtogroup cc26xx-web-demo + * \addtogroup cc26x0-web-demo * @{ * * \file diff --git a/examples/platform-specific/cc26xx/project-conf.h b/examples/platform-specific/cc26x0-cc13x0/project-conf.h similarity index 100% rename from examples/platform-specific/cc26xx/project-conf.h rename to examples/platform-specific/cc26x0-cc13x0/project-conf.h diff --git a/examples/platform-specific/cc26xx/very-sleepy-demo/Makefile b/examples/platform-specific/cc26x0-cc13x0/very-sleepy-demo/Makefile similarity index 83% rename from examples/platform-specific/cc26xx/very-sleepy-demo/Makefile rename to examples/platform-specific/cc26x0-cc13x0/very-sleepy-demo/Makefile index 46da822d3..d62dff3e3 100644 --- a/examples/platform-specific/cc26xx/very-sleepy-demo/Makefile +++ b/examples/platform-specific/cc26x0-cc13x0/very-sleepy-demo/Makefile @@ -1,6 +1,6 @@ CONTIKI_PROJECT = very-sleepy-demo -PLATFORMS_ONLY = srf06-cc26xx +PLATFORMS_ONLY = cc26x0-cc13x0 all: $(CONTIKI_PROJECT) diff --git a/examples/platform-specific/cc26xx/very-sleepy-demo/Makefile.target b/examples/platform-specific/cc26x0-cc13x0/very-sleepy-demo/Makefile.target similarity index 100% rename from examples/platform-specific/cc26xx/very-sleepy-demo/Makefile.target rename to examples/platform-specific/cc26x0-cc13x0/very-sleepy-demo/Makefile.target diff --git a/examples/platform-specific/cc26xx/very-sleepy-demo/README.md b/examples/platform-specific/cc26x0-cc13x0/very-sleepy-demo/README.md similarity index 100% rename from examples/platform-specific/cc26xx/very-sleepy-demo/README.md rename to examples/platform-specific/cc26x0-cc13x0/very-sleepy-demo/README.md diff --git a/examples/platform-specific/cc26xx/very-sleepy-demo/project-conf.h b/examples/platform-specific/cc26x0-cc13x0/very-sleepy-demo/project-conf.h similarity index 100% rename from examples/platform-specific/cc26xx/very-sleepy-demo/project-conf.h rename to examples/platform-specific/cc26x0-cc13x0/very-sleepy-demo/project-conf.h diff --git a/examples/platform-specific/cc26xx/very-sleepy-demo/very-sleepy-demo.c b/examples/platform-specific/cc26x0-cc13x0/very-sleepy-demo/very-sleepy-demo.c similarity index 100% rename from examples/platform-specific/cc26xx/very-sleepy-demo/very-sleepy-demo.c rename to examples/platform-specific/cc26x0-cc13x0/very-sleepy-demo/very-sleepy-demo.c diff --git a/examples/platform-specific/cc26xx/ble-ipv6/Makefile b/examples/platform-specific/cc26xx/ble-ipv6/Makefile deleted file mode 100644 index 4ba928ad3..000000000 --- a/examples/platform-specific/cc26xx/ble-ipv6/Makefile +++ /dev/null @@ -1,11 +0,0 @@ -CONTIKI_PROJECT=client - -all: $(CONTIKI_PROJECT) - -PLATFORMS_ONLY = srf06-cc26xx -BOARDS_ONLY = launchpad/cc2650 sensortag/cc2650 srf06/cc26xx - -MAKE_MAC = MAKE_MAC_BLE -MAKE_NET = MAKE_NET_IPV6 -CONTIKI = ../../../.. -include $(CONTIKI)/Makefile.include \ No newline at end of file diff --git a/examples/platform-specific/zoul/orion/ip64-router/ip64-router.c b/examples/platform-specific/zoul/orion/ip64-router/ip64-router.c index 5f2a98e24..4b3279e44 100644 --- a/examples/platform-specific/zoul/orion/ip64-router/ip64-router.c +++ b/examples/platform-specific/zoul/orion/ip64-router/ip64-router.c @@ -45,6 +45,7 @@ #include "contiki-net.h" #include "net/ipv6/uip.h" #include "net/ipv6/uip-ds6.h" +#include "net/ipv6/uip-ds6-nbr.h" #include "net/routing/routing.h" #include "dev/leds.h" #include "ip64/ip64.h" @@ -142,9 +143,9 @@ PT_THREAD(generate_routes(struct httpd_state *s)) #endif ADD("Neighbors
");
 
-  for(nbr = nbr_table_head(ds6_neighbors);
+  for(nbr = uip_ds6_nbr_head();
       nbr != NULL;
-      nbr = nbr_table_next(ds6_neighbors, nbr)) {
+      nbr = uip_ds6_nbr_next(nbr)) {
 
 #if WEBSERVER_CONF_NEIGHBOR_STATUS
 #if BUF_USES_STACK
diff --git a/examples/rpl-border-router/webserver/webserver.c b/examples/rpl-border-router/webserver/webserver.c
index 3658381bf..c4b472837 100644
--- a/examples/rpl-border-router/webserver/webserver.c
+++ b/examples/rpl-border-router/webserver/webserver.c
@@ -32,6 +32,7 @@
 
 #include "contiki.h"
 #include "net/routing/routing.h"
+#include "net/ipv6/uip-ds6-nbr.h"
 #include "net/ipv6/uip-ds6-route.h"
 #include "net/ipv6/uip-sr.h"
 
@@ -90,9 +91,9 @@ PT_THREAD(generate_routes(struct httpd_state *s))
 
   ADD("  Neighbors\n  
    \n"); SEND(&s->sout); - for(nbr = nbr_table_head(ds6_neighbors); + for(nbr = uip_ds6_nbr_head(); nbr != NULL; - nbr = nbr_table_next(ds6_neighbors, nbr)) { + nbr = uip_ds6_nbr_next(nbr)) { ADD("
  • "); ipaddr_add(&nbr->ipaddr); ADD("
  • \n"); diff --git a/examples/sensniff/Makefile b/examples/sensniff/Makefile index 090bc694d..3b7c5116c 100644 --- a/examples/sensniff/Makefile +++ b/examples/sensniff/Makefile @@ -1,7 +1,7 @@ CONTIKI_PROJECT = sensniff CONTIKI = ../.. -PLATFORMS_ONLY = cc2538dk openmote-cc2538 zoul srf06-cc26xx jn516x simplelink +PLATFORMS_ONLY = cc2538dk openmote-cc2538 zoul cc26x0-cc13x0 jn516x simplelink PROJECT_SOURCEFILES += sensniff-mac.c netstack.c MODULES_REL += pool $(TARGET) diff --git a/examples/sensniff/srf06-cc26xx/target-conf.h b/examples/sensniff/cc26x0-cc13x0/target-conf.h similarity index 100% rename from examples/sensniff/srf06-cc26xx/target-conf.h rename to examples/sensniff/cc26x0-cc13x0/target-conf.h diff --git a/examples/storage/cfs-coffee/README.md b/examples/storage/cfs-coffee/README.md index 028f518f8..640124d56 100644 --- a/examples/storage/cfs-coffee/README.md +++ b/examples/storage/cfs-coffee/README.md @@ -23,7 +23,7 @@ Supported Hardware (tested or known to work) * cc2538dk * openmote-cc2538 * zoul -* TI srf06-cc26xx +* TI cc26x0-cc13x0 - sensortag - launchpad diff --git a/os/contiki-main.c b/os/contiki-main.c index db8893717..43e301746 100644 --- a/os/contiki-main.c +++ b/os/contiki-main.c @@ -48,6 +48,7 @@ #include "sys/stack-check.h" #include "dev/watchdog.h" +#include "net/queuebuf.h" #include "net/app-layer/coap/coap-engine.h" #include "services/rpl-border-router/rpl-border-router.h" #include "services/orchestra/orchestra.h" @@ -89,6 +90,9 @@ main(void) platform_init_stage_two(); +#if QUEUEBUF_ENABLED + queuebuf_init(); +#endif /* QUEUEBUF_ENABLED */ netstack_init(); node_id_init(); diff --git a/os/dev/gpio-hal.h b/os/dev/gpio-hal.h index 9fe541772..5ad9f472b 100644 --- a/os/dev/gpio-hal.h +++ b/os/dev/gpio-hal.h @@ -189,7 +189,7 @@ void gpio_hal_event_handler(gpio_hal_pin_mask_t pins); * \param pin The pin * \return The corresponding mask */ -#define gpio_hal_pin_to_mask(pin) (1 << (pin)) +#define gpio_hal_pin_to_mask(pin) ((gpio_hal_pin_mask_t)1 << (pin)) /** @} */ /*---------------------------------------------------------------------------*/ /** diff --git a/os/net/app-layer/coap/coap-conf.h b/os/net/app-layer/coap/coap-conf.h index 911017ed8..5b610dca3 100644 --- a/os/net/app-layer/coap/coap-conf.h +++ b/os/net/app-layer/coap/coap-conf.h @@ -99,7 +99,9 @@ #endif /* COAP_MAX_OBSERVERS */ /* Interval in notifies in which NON notifies are changed to CON notifies to check client. */ -#ifndef COAP_OBSERVE_REFRESH_INTERVAL +#ifdef COAP_CONF_OBSERVE_REFRESH_INTERVAL +#define COAP_OBSERVE_REFRESH_INTERVAL COAP_CONF_OBSERVE_REFRESH_INTERVAL +#else #define COAP_OBSERVE_REFRESH_INTERVAL 20 #endif /* COAP_OBSERVE_REFRESH_INTERVAL */ diff --git a/os/net/app-layer/coap/coap-observe.c b/os/net/app-layer/coap/coap-observe.c index d6ef3887e..3574acac4 100644 --- a/os/net/app-layer/coap/coap-observe.c +++ b/os/net/app-layer/coap/coap-observe.c @@ -244,7 +244,9 @@ coap_notify_observers_sub(coap_resource_t *resource, const char *subpath) /*TODO implement special transaction for CON, sharing the same buffer to allow for more observers */ if((transaction = coap_new_transaction(coap_get_mid(), &obs->endpoint))) { - if(obs->obs_counter % COAP_OBSERVE_REFRESH_INTERVAL == 0) { + /* if COAP_OBSERVE_REFRESH_INTERVAL is zero, never send observations as confirmable messages */ + if(COAP_OBSERVE_REFRESH_INTERVAL != 0 + && (obs->obs_counter % COAP_OBSERVE_REFRESH_INTERVAL == 0)) { LOG_DBG(" Force Confirmable for\n"); notification->type = COAP_TYPE_CON; } diff --git a/os/net/ipv6/sicslowpan.c b/os/net/ipv6/sicslowpan.c index 44851e93d..35128c3d7 100644 --- a/os/net/ipv6/sicslowpan.c +++ b/os/net/ipv6/sicslowpan.c @@ -2057,11 +2057,6 @@ sicslowpan_init(void) #endif /* SICSLOWPAN_CONF_MAX_ADDR_CONTEXTS > 1 */ #endif /* SICSLOWPAN_COMPRESSION == SICSLOWPAN_COMPRESSION_IPHC */ - - /* We use the queuebuf module if fragmentation is enabled */ -#if SICSLOWPAN_CONF_FRAG - queuebuf_init(); -#endif } /*--------------------------------------------------------------------*/ int diff --git a/os/net/ipv6/uip-ds6-nbr.c b/os/net/ipv6/uip-ds6-nbr.c index f937986b5..b8f8b63d7 100644 --- a/os/net/ipv6/uip-ds6-nbr.c +++ b/os/net/ipv6/uip-ds6-nbr.c @@ -55,19 +55,67 @@ #include "net/ipv6/uip-nd6.h" #include "net/routing/routing.h" +#if UIP_DS6_NBR_MULTI_IPV6_ADDRS +#include "lib/memb.h" +#endif /* UIP_DS6_NBR_MULTI_IPV6_ADDRS */ + /* Log configuration */ #include "sys/log.h" #define LOG_MODULE "IPv6 Nbr" #define LOG_LEVEL LOG_LEVEL_IPV6 -NBR_TABLE_GLOBAL(uip_ds6_nbr_t, ds6_neighbors); +#if UIP_DS6_NBR_MULTI_IPV6_ADDRS +/** + * Add nbr to the list in nbr_entry. In other words, this function associates an + * IPv6 address in nbr with a link-layer address in nbr_entry. + * \param nbr the neighbor cache entry for an IPv6 address + * \param nbr_entry the nbr_table entry for an link-layer address + */ +static void add_uip_ds6_nbr_to_nbr_entry(uip_ds6_nbr_t *nbr, + uip_ds6_nbr_entry_t *nbr_entry); + +/** + * Remove nbr from the list of the corresponding nbr_entry + * \param nbr a neighbor cache entry (nbr) to be removed + */ +static void remove_uip_ds6_nbr_from_nbr_entry(uip_ds6_nbr_t *nbr); + +/** + * Remove nbr_etnry from nbr_table + * \param nbr_entry a nbr_table entry (nbr_entry) to be removed + */ +static void remove_nbr_entry(uip_ds6_nbr_entry_t *nbr_entry); + +/** + * Free memory for a specified neighbor cache entry + * \param nbr a neighbor cache entry to be freed + */ +static void free_uip_ds6_nbr(uip_ds6_nbr_t *nbr); + +/** + * Callback function called when a nbr_table entry is removed + * \param nbr_entry a nbr_entry to be removed + */ +static void callback_nbr_entry_removal(uip_ds6_nbr_entry_t *nbr_entry); + +NBR_TABLE(uip_ds6_nbr_entry_t, uip_ds6_nbr_entries); +MEMB(uip_ds6_nbr_memb, uip_ds6_nbr_t, UIP_DS6_NBR_MAX_NEIGHBOR_CACHES); +#else +NBR_TABLE(uip_ds6_nbr_t, ds6_neighbors); +#endif /* UIP_DS6_NBR_MULTI_IPV6_ADDRS */ /*---------------------------------------------------------------------------*/ void uip_ds6_neighbors_init(void) { link_stats_init(); +#if UIP_DS6_NBR_MULTI_IPV6_ADDRS + memb_init(&uip_ds6_nbr_memb); + nbr_table_register(uip_ds6_nbr_entries, + (nbr_table_callback *)callback_nbr_entry_removal); +#else nbr_table_register(ds6_neighbors, (nbr_table_callback *)uip_ds6_nbr_rm); +#endif /* UIP_DS6_NBR_MULTI_IPV6_ADDRS */ } /*---------------------------------------------------------------------------*/ uip_ds6_nbr_t * @@ -75,8 +123,63 @@ uip_ds6_nbr_add(const uip_ipaddr_t *ipaddr, const uip_lladdr_t *lladdr, uint8_t isrouter, uint8_t state, nbr_table_reason_t reason, void *data) { - uip_ds6_nbr_t *nbr = nbr_table_add_lladdr(ds6_neighbors, (linkaddr_t*)lladdr - , reason, data); + uip_ds6_nbr_t *nbr; + +#if UIP_DS6_NBR_MULTI_IPV6_ADDRS + uip_ds6_nbr_entry_t *nbr_entry; + + assert(uip_ds6_nbr_lookup(ipaddr) == NULL); + if(uip_ds6_nbr_lookup(ipaddr)) { + LOG_ERR("%s: uip_ds6_nbr for ", __func__); + LOG_ERR_6ADDR(ipaddr); + LOG_ERR_("has already existed\n"); + return NULL; + } + + /* firstly, allocate memory for a new nbr cache entry */ + if((nbr = (uip_ds6_nbr_t *)memb_alloc(&uip_ds6_nbr_memb)) == NULL) { + LOG_ERR("%s: cannot allocate a new uip_ds6_nbr\n", __func__); + return NULL; + } + + /* secondly, get or allocate nbr_entry for the link-layer address */ + nbr_entry = nbr_table_get_from_lladdr(uip_ds6_nbr_entries, + (const linkaddr_t *)lladdr); + if(nbr_entry == NULL) { + if((nbr_entry = + nbr_table_add_lladdr(uip_ds6_nbr_entries, + (linkaddr_t*)lladdr, reason, data)) == NULL) { + LOG_ERR("%s: cannot allocate a new uip_ds6_nbr_entry\n", __func__); + /* return from this function later */ + } else { + LIST_STRUCT_INIT(nbr_entry, uip_ds6_nbrs); + } + } + + /* free nbr and return if nbr_entry is not available */ + if((nbr_entry == NULL) || + (list_length(nbr_entry->uip_ds6_nbrs) == UIP_DS6_NBR_MAX_6ADDRS_PER_NBR)) { + if(list_length(nbr_entry->uip_ds6_nbrs) == UIP_DS6_NBR_MAX_6ADDRS_PER_NBR) { + /* + * it's already had the maximum number of IPv6 addresses; cannot + * add another. + */ + LOG_ERR("%s: no room in nbr_entry for ", __func__); + LOG_ERR_LLADDR((const linkaddr_t *)lladdr); + LOG_ERR_("\n"); + } + /* free the newly allocated memory in this function call */ + memb_free(&uip_ds6_nbr_memb, nbr); + return NULL; + } else { + /* everything is fine; nbr is ready to be used */ + /* it has room to add another IPv6 address */ + add_uip_ds6_nbr_to_nbr_entry(nbr, nbr_entry); + } +#else + nbr = nbr_table_add_lladdr(ds6_neighbors, (linkaddr_t*)lladdr, reason, data); +#endif /* UIP_DS6_NBR_MULTI_IPV6_ADDRS */ + if(nbr) { uip_ipaddr_copy(&nbr->ipaddr, ipaddr); #if UIP_ND6_SEND_RA || !UIP_CONF_ROUTER @@ -113,10 +216,91 @@ uip_ds6_nbr_add(const uip_ipaddr_t *ipaddr, const uip_lladdr_t *lladdr, } } +#if UIP_DS6_NBR_MULTI_IPV6_ADDRS +/*---------------------------------------------------------------------------*/ +static void +add_uip_ds6_nbr_to_nbr_entry(uip_ds6_nbr_t *nbr, + uip_ds6_nbr_entry_t *nbr_entry) +{ + LOG_DBG("%s: add nbr(%p) to nbr_entry (%p)\n", + __func__, nbr, nbr_entry); + nbr->nbr_entry = nbr_entry; + list_add(nbr_entry->uip_ds6_nbrs, nbr); +} +/*---------------------------------------------------------------------------*/ +static void +remove_uip_ds6_nbr_from_nbr_entry(uip_ds6_nbr_t *nbr) +{ + if(nbr == NULL) { + return; + } + LOG_DBG("%s: remove nbr(%p) from nbr_entry (%p)\n", + __func__, nbr, nbr->nbr_entry); + list_remove(nbr->nbr_entry->uip_ds6_nbrs, nbr); +} +/*---------------------------------------------------------------------------*/ +static void +remove_nbr_entry(uip_ds6_nbr_entry_t *nbr_entry) +{ + if(nbr_entry == NULL) { + return; + } + LOG_DBG("%s: remove nbr_entry (%p) from nbr_table\n", + __func__, nbr_entry); + (void)nbr_table_remove(uip_ds6_nbr_entries, nbr_entry); +} +/*---------------------------------------------------------------------------*/ +static void +free_uip_ds6_nbr(uip_ds6_nbr_t *nbr) +{ + if(nbr == NULL) { + return; + } +#if UIP_CONF_IPV6_QUEUE_PKT + uip_packetqueue_free(&nbr->packethandle); +#endif /* UIP_CONF_IPV6_QUEUE_PKT */ + NETSTACK_ROUTING.neighbor_state_changed(nbr); + assert(nbr->nbr_entry != NULL); + if(nbr->nbr_entry == NULL) { + LOG_ERR("%s: unexpected error nbr->nbr_entry is NULL\n", __func__); + } else { + remove_uip_ds6_nbr_from_nbr_entry(nbr); + if(list_length(nbr->nbr_entry->uip_ds6_nbrs) == 0) { + remove_nbr_entry(nbr->nbr_entry); + } + } + LOG_DBG("%s: free memory for nbr(%p)\n", __func__, nbr); + memb_free(&uip_ds6_nbr_memb, nbr); +} +/*---------------------------------------------------------------------------*/ +static void +callback_nbr_entry_removal(uip_ds6_nbr_entry_t *nbr_entry) +{ + uip_ds6_nbr_t *nbr; + uip_ds6_nbr_t *next_nbr; + if(nbr_entry == NULL) { + return; + } + for(nbr = (uip_ds6_nbr_t *)list_head(nbr_entry->uip_ds6_nbrs); + nbr != NULL; + nbr = next_nbr) { + next_nbr = (uip_ds6_nbr_t *)list_item_next(nbr); + free_uip_ds6_nbr(nbr); + } +} +#endif /* UIP_DS6_NBR_MULTI_IPV6_ADDRS */ /*---------------------------------------------------------------------------*/ int uip_ds6_nbr_rm(uip_ds6_nbr_t *nbr) { +#if UIP_DS6_NBR_MULTI_IPV6_ADDRS + if(nbr == NULL) { + return 0; + } else { + free_uip_ds6_nbr(nbr); + return 1; + } +#else /* UIP_DS6_NBR_MULTI_IPV6_ADDRS */ if(nbr != NULL) { #if UIP_CONF_IPV6_QUEUE_PKT uip_packetqueue_free(&nbr->packethandle); @@ -125,19 +309,52 @@ uip_ds6_nbr_rm(uip_ds6_nbr_t *nbr) return nbr_table_remove(ds6_neighbors, nbr); } return 0; +#endif /* UIP_DS6_NBR_MULTI_IPV6_ADDRS */ } /*---------------------------------------------------------------------------*/ int uip_ds6_nbr_update_ll(uip_ds6_nbr_t **nbr_pp, const uip_lladdr_t *new_ll_addr) { +#if UIP_DS6_NBR_MULTI_IPV6_ADDRS + uip_ds6_nbr_entry_t *nbr_entry; + uip_ds6_nbr_t *nbr; +#else uip_ds6_nbr_t nbr_backup; +#endif /* UIP_DS6_NBR_MULTI_IPV6_ADDRS */ if(nbr_pp == NULL || new_ll_addr == NULL) { LOG_ERR("%s: invalid argument\n", __func__); return -1; } +#if UIP_DS6_NBR_MULTI_IPV6_ADDRS + + if((nbr_entry = + nbr_table_get_from_lladdr(uip_ds6_nbr_entries, + (const linkaddr_t *)new_ll_addr)) == NULL) { + if((nbr_entry = + nbr_table_add_lladdr(uip_ds6_nbr_entries, + (const linkaddr_t*)new_ll_addr, + NBR_TABLE_REASON_IPV6_ND, NULL)) == NULL) { + LOG_ERR("%s: cannot allocate a nbr_entry for", __func__); + LOG_ERR_LLADDR((const linkaddr_t *)new_ll_addr); + return -1; + } else { + LIST_STRUCT_INIT(nbr_entry, uip_ds6_nbrs); + } + } + + nbr = *nbr_pp; + + remove_uip_ds6_nbr_from_nbr_entry(nbr); + if(list_length(nbr->nbr_entry->uip_ds6_nbrs) == 0) { + remove_nbr_entry(nbr->nbr_entry); + } + add_uip_ds6_nbr_to_nbr_entry(nbr, nbr_entry); + +#else /* UIP_DS6_NBR_MULTI_IPV6_ADDRS */ + /* make sure new_ll_addr is not used in some other nbr */ if(uip_ds6_nbr_ll_lookup(new_ll_addr) != NULL) { LOG_ERR("%s: new_ll_addr, ", __func__); @@ -159,6 +376,7 @@ uip_ds6_nbr_update_ll(uip_ds6_nbr_t **nbr_pp, const uip_lladdr_t *new_ll_addr) return -1; } memcpy(*nbr_pp, &nbr_backup, sizeof(uip_ds6_nbr_t)); +#endif /* UIP_DS6_NBR_MULTI_IPV6_ADDRS */ return 0; } @@ -173,46 +391,88 @@ uip_ds6_nbr_get_ipaddr(const uip_ds6_nbr_t *nbr) const uip_lladdr_t * uip_ds6_nbr_get_ll(const uip_ds6_nbr_t *nbr) { +#if UIP_DS6_NBR_MULTI_IPV6_ADDRS + if(nbr == NULL) { + return NULL; + } + return (const uip_lladdr_t *)nbr_table_get_lladdr(uip_ds6_nbr_entries, + nbr->nbr_entry); +#else return (const uip_lladdr_t *)nbr_table_get_lladdr(ds6_neighbors, nbr); +#endif /* UIP_DS6_NBR_MULTI_IPV6_ADDRS */ } /*---------------------------------------------------------------------------*/ int uip_ds6_nbr_num(void) { - uip_ds6_nbr_t *nbr; - int num; + int num = 0; - num = 0; +#if UIP_DS6_NBR_MULTI_IPV6_ADDRS + uip_ds6_nbr_entry_t *nbr_entry; + for(nbr_entry = nbr_table_head(uip_ds6_nbr_entries); + nbr_entry != NULL; + nbr_entry = nbr_table_next(uip_ds6_nbr_entries, nbr_entry)) { + num += list_length(nbr_entry->uip_ds6_nbrs); + } +#else + uip_ds6_nbr_t *nbr; for(nbr = nbr_table_head(ds6_neighbors); nbr != NULL; nbr = nbr_table_next(ds6_neighbors, nbr)) { num++; } +#endif /* UIP_DS6_NBR_MULTI_IPV6_ADDRS */ return num; } /*---------------------------------------------------------------------------*/ uip_ds6_nbr_t * uip_ds6_nbr_head(void) { +#if UIP_DS6_NBR_MULTI_IPV6_ADDRS + uip_ds6_nbr_entry_t *nbr_entry; + if((nbr_entry = nbr_table_head(uip_ds6_nbr_entries)) == NULL) { + return NULL; + } + assert(list_head(nbr_entry->uip_ds6_nbrs) != NULL); + return (uip_ds6_nbr_t *)list_head(nbr_entry->uip_ds6_nbrs); +#else return nbr_table_head(ds6_neighbors); +#endif /* UIP_DS6_NBR_MULTI_IPV6_ADDRS */ } /*---------------------------------------------------------------------------*/ uip_ds6_nbr_t * uip_ds6_nbr_next(uip_ds6_nbr_t *nbr) { +#if UIP_DS6_NBR_MULTI_IPV6_ADDRS + uip_ds6_nbr_entry_t *nbr_entry; + if(nbr == NULL) { + return NULL; + } + if(list_item_next(nbr) != NULL) { + return list_item_next(nbr); + } + nbr_entry = nbr_table_next(uip_ds6_nbr_entries, nbr->nbr_entry); + if(nbr_entry == NULL) { + return NULL; + } else { + assert(list_head(nbr_entry->uip_ds6_nbrs) != NULL); + return (uip_ds6_nbr_t *)list_head(nbr_entry->uip_ds6_nbrs); + } +#else return nbr_table_next(ds6_neighbors, nbr); +#endif /* UIP_DS6_NBR_MULTI_IPV6_ADDRS */ } /*---------------------------------------------------------------------------*/ uip_ds6_nbr_t * uip_ds6_nbr_lookup(const uip_ipaddr_t *ipaddr) { - uip_ds6_nbr_t *nbr = nbr_table_head(ds6_neighbors); - if(ipaddr != NULL) { - while(nbr != NULL) { - if(uip_ipaddr_cmp(&nbr->ipaddr, ipaddr)) { - return nbr; - } - nbr = nbr_table_next(ds6_neighbors, nbr); + uip_ds6_nbr_t *nbr; + if(ipaddr == NULL) { + return NULL; + } + for(nbr = uip_ds6_nbr_head(); nbr != NULL; nbr = uip_ds6_nbr_next(nbr)) { + if(uip_ipaddr_cmp(&nbr->ipaddr, ipaddr)) { + return nbr; } } return NULL; @@ -221,7 +481,23 @@ uip_ds6_nbr_lookup(const uip_ipaddr_t *ipaddr) uip_ds6_nbr_t * uip_ds6_nbr_ll_lookup(const uip_lladdr_t *lladdr) { +#if UIP_DS6_NBR_MULTI_IPV6_ADDRS + uip_ds6_nbr_entry_t *nbr_entry; + /* + * we cannot determine which entry should return by lladdr alone; + * return the first entry associated with lladdr. + */ + nbr_entry = + (uip_ds6_nbr_entry_t *)nbr_table_get_from_lladdr(uip_ds6_nbr_entries, + (linkaddr_t*)lladdr); + if(nbr_entry == NULL) { + return NULL; + } + assert(list_head(nbr_entry->uip_ds6_nbrs) != NULL); + return (uip_ds6_nbr_t *)list_head(nbr_entry->uip_ds6_nbrs); +#else return nbr_table_get_from_lladdr(ds6_neighbors, (linkaddr_t*)lladdr); +#endif /* UIP_DS6_NBR_MULTI_IPV6_ADDRS */ } /*---------------------------------------------------------------------------*/ @@ -239,6 +515,20 @@ uip_ds6_nbr_lladdr_from_ipaddr(const uip_ipaddr_t *ipaddr) uip_ds6_nbr_t *nbr = uip_ds6_nbr_lookup(ipaddr); return nbr ? uip_ds6_nbr_get_ll(nbr) : NULL; } +#if UIP_DS6_LL_NUD +/*---------------------------------------------------------------------------*/ +static void +update_nbr_reachable_state_by_ack(uip_ds6_nbr_t *nbr, const linkaddr_t *lladdr) +{ + if(nbr != NULL && nbr->state != NBR_INCOMPLETE) { + nbr->state = NBR_REACHABLE; + stimer_set(&nbr->reachable, UIP_ND6_REACHABLE_TIME / 1000); + LOG_INFO("received a link layer ACK : "); + LOG_INFO_LLADDR(lladdr); + LOG_INFO_(" is reachable.\n"); + } +} +#endif /* UIP_DS6_LL_NUD */ /*---------------------------------------------------------------------------*/ void uip_ds6_link_callback(int status, int numtx) @@ -266,14 +556,22 @@ uip_ds6_link_callback(int status, int numtx) * acknowledges link packets. */ if(status == MAC_TX_OK) { uip_ds6_nbr_t *nbr; - nbr = uip_ds6_nbr_ll_lookup((uip_lladdr_t *)dest); - if(nbr != NULL && nbr->state != NBR_INCOMPLETE) { - nbr->state = NBR_REACHABLE; - stimer_set(&nbr->reachable, UIP_ND6_REACHABLE_TIME / 1000); - LOG_INFO("received a link layer ACK : "); - LOG_INFO_LLADDR((uip_lladdr_t *)dest); - LOG_INFO_(" is reachable.\n"); +#if UIP_DS6_NBR_MULTI_IPV6_ADDRS + uip_ds6_nbr_entry_t *nbr_entry; + if((nbr_entry = + (uip_ds6_nbr_entry_t *)nbr_table_get_from_lladdr(uip_ds6_nbr_entries, + dest)) == NULL) { + return; } + for(nbr = (uip_ds6_nbr_t *)list_head(nbr_entry->uip_ds6_nbrs); + nbr != NULL; + nbr = (uip_ds6_nbr_t *)list_item_next(nbr)) { + update_nbr_reachable_state_by_ack(nbr, dest); + } +#else /* UIP_DS6_NBR_MULTI_IPV6_ADDRS */ + nbr = uip_ds6_nbr_ll_lookup((uip_lladdr_t *)dest); + update_nbr_reachable_state_by_ack(nbr, dest); +#endif /* UIP_DS6_NBR_MULTI_IPV6_ADDRS */ } #endif /* UIP_DS6_LL_NUD */ } @@ -283,7 +581,7 @@ uip_ds6_link_callback(int status, int numtx) void uip_ds6_neighbor_periodic(void) { - uip_ds6_nbr_t *nbr = nbr_table_head(ds6_neighbors); + uip_ds6_nbr_t *nbr = uip_ds6_nbr_head(); while(nbr != NULL) { switch(nbr->state) { case NBR_REACHABLE: @@ -354,7 +652,7 @@ uip_ds6_neighbor_periodic(void) default: break; } - nbr = nbr_table_next(ds6_neighbors, nbr); + nbr = uip_ds6_nbr_next(nbr); } } /*---------------------------------------------------------------------------*/ @@ -373,7 +671,7 @@ uip_ds6_nbr_refresh_reachable_state(const uip_ipaddr_t *ipaddr) uip_ds6_nbr_t * uip_ds6_get_least_lifetime_neighbor(void) { - uip_ds6_nbr_t *nbr = nbr_table_head(ds6_neighbors); + uip_ds6_nbr_t *nbr = uip_ds6_nbr_head(); uip_ds6_nbr_t *nbr_expiring = NULL; while(nbr != NULL) { if(nbr_expiring != NULL) { @@ -384,7 +682,7 @@ uip_ds6_get_least_lifetime_neighbor(void) } else { nbr_expiring = nbr; } - nbr = nbr_table_next(ds6_neighbors, nbr); + nbr = uip_ds6_nbr_next(nbr); } return nbr_expiring; } diff --git a/os/net/ipv6/uip-ds6-nbr.h b/os/net/ipv6/uip-ds6-nbr.h index d645ac627..6479c972e 100644 --- a/os/net/ipv6/uip-ds6-nbr.h +++ b/os/net/ipv6/uip-ds6-nbr.h @@ -54,6 +54,10 @@ #if UIP_CONF_IPV6_QUEUE_PKT #include "net/ipv6/uip-packetqueue.h" #endif /*UIP_CONF_QUEUE_PKT */ +#if UIP_DS6_NBR_CONF_MULTI_IPV6_ADDRS +#include "lib/assert.h" +#include "lib/list.h" +#endif /*--------------------------------------------------*/ /** \brief Possible states for the nbr cache entries */ @@ -63,10 +67,46 @@ #define NBR_DELAY 3 #define NBR_PROBE 4 -NBR_TABLE_DECLARE(ds6_neighbors); +/** \brief Set non-zero (1) to enable multiple IPv6 addresses to be + * associated with a link-layer address */ +#ifdef UIP_DS6_NBR_CONF_MULTI_IPV6_ADDRS +#define UIP_DS6_NBR_MULTI_IPV6_ADDRS UIP_DS6_NBR_CONF_MULTI_IPV6_ADDRS +#else +#define UIP_DS6_NBR_MULTI_IPV6_ADDRS 0 +#endif /* UIP_DS6_NBR_CONF_MULTI_IPV6_ADDRS */ -/** \brief An entry in the nbr cache */ +/** \brief Set the maximum number of IPv6 addresses per link-layer + * address */ +#ifdef UIP_DS6_NBR_CONF_MAX_6ADDRS_PER_NBR +#define UIP_DS6_NBR_MAX_6ADDRS_PER_NBR UIP_DS6_NBR_CONF_MAX_6ADDRS_PER_NBR +#else +#define UIP_DS6_NBR_MAX_6ADDRS_PER_NBR 2 +#endif /* UIP_DS6_NBR_CONF_MAX_6ADDRS_PER_NBR */ + +/** \brief Set the maximum number of neighbor cache entries */ +#ifdef UIP_DS6_NBR_CONF_MAX_NEIGHBOR_CACHES +#define UIP_DS6_NBR_MAX_NEIGHBOR_CACHES UIP_DS6_NBR_CONF_MAX_NEIGHBOR_CACHES +#else +#define UIP_DS6_NBR_MAX_NEIGHBOR_CACHES \ + (NBR_TABLE_MAX_NEIGHBORS * UIP_DS6_NBR_MAX_6ADDRS_PER_NBR) +#endif /* UIP_DS6_NBR_CONF_MAX_NEIGHBOR_CACHES */ + +#if UIP_DS6_NBR_MULTI_IPV6_ADDRS +/** \brief nbr_table entry when UIP_DS6_NBR_MULTI_IPV6_ADDRS is + * enabled. uip_ds6_nbrs is a list of uip_ds6_nbr_t objects */ +typedef struct { + LIST_STRUCT(uip_ds6_nbrs); +} uip_ds6_nbr_entry_t; +#endif /* UIP_DS6_NBR_MULTI_IPV6_ADDRS */ + +/** \brief The default nbr_table entry (when + * UIP_DS6_NBR_MULTI_IPV6_ADDRS is disabled), that implements nbr + * cache */ typedef struct uip_ds6_nbr { +#if UIP_DS6_NBR_MULTI_IPV6_ADDRS + struct uip_ds6_nbr *next; + uip_ds6_nbr_entry_t *nbr_entry; +#endif /* UIP_DS6_NBR_MULTI_IPV6_ADDRS */ uip_ipaddr_t ipaddr; uint8_t isrouter; uint8_t state; @@ -83,25 +123,119 @@ typedef struct uip_ds6_nbr { void uip_ds6_neighbors_init(void); -/** \brief Neighbor Cache basic routines */ +/** + * Add a neighbor cache for a specified IPv6 address, which is + * associated with a specified link-layer address + * \param ipaddr IPv6 address of a neighbor to add + * \param lladdr Link-layer address to associate with ipaddr + * \param isrouter Set 1 if the neighbor is a router + * \param state Set the initial neighbor cache state (e.g., + * NBR_INCOMPLETE) + * \param reason Set a reason of the addition (e.g., + * NBR_TABLE_REASON_RPL_DIO) + * \param data Set data associated with the nbr cache + * \return the address of a newly added nbr cache on success, NULL on + * failure +*/ uip_ds6_nbr_t *uip_ds6_nbr_add(const uip_ipaddr_t *ipaddr, const uip_lladdr_t *lladdr, uint8_t isrouter, uint8_t state, nbr_table_reason_t reason, void *data); + +/** + * Remove a neighbor cache + * \param nbr the address of a neighbor cache to remove + * \return 1 on success, 0 on failure (nothing was removed) + */ int uip_ds6_nbr_rm(uip_ds6_nbr_t *nbr); + +/** + * Get the link-layer address associated with a specified nbr cache + * \param nbr the address of a neighbor cache + * \return pointer to the link-layer address on success, NULL on failure + */ const uip_lladdr_t *uip_ds6_nbr_get_ll(const uip_ds6_nbr_t *nbr); -int uip_ds6_nbr_update_ll(uip_ds6_nbr_t **nbr, const uip_lladdr_t *new_ll_addr); -const uip_ipaddr_t *uip_ds6_nbr_get_ipaddr(const uip_ds6_nbr_t *nbr); -uip_ds6_nbr_t *uip_ds6_nbr_lookup(const uip_ipaddr_t *ipaddr); -uip_ds6_nbr_t *uip_ds6_nbr_ll_lookup(const uip_lladdr_t *lladdr); -uip_ipaddr_t *uip_ds6_nbr_ipaddr_from_lladdr(const uip_lladdr_t *lladdr); + +/** + * Get the link-layer address associated with a specified IPv6 address + * \param ipaddr an IPv6 address used as a search key + * \return the pointer to the link-layer address on success, NULL on failure + */ const uip_lladdr_t *uip_ds6_nbr_lladdr_from_ipaddr(const uip_ipaddr_t *ipaddr); -void uip_ds6_link_callback(int status, int numtx); -void uip_ds6_neighbor_periodic(void); + +/** + * Update the link-layer address associated with an IPv6 address + * \param nbr the double pointer to a neighbor cache which has the + * target IPv6 address + * \param new_ll_addr the new link-layer address of the IPv6 address + * return 0 on success, -1 on failure + */ +int uip_ds6_nbr_update_ll(uip_ds6_nbr_t **nbr, const uip_lladdr_t *new_ll_addr); + +/** + * Get an IPv6 address of a neighbor cache + * \param nbr the pointer to a neighbor cache + * \return the pointer to an IPv6 address associated with the neighbor cache + * \note This returns the first IPv6 address found in the neighbor + * cache when UIP_DS6_NBR_MULTI_IPV6_ADDRS is enabled + */ +const uip_ipaddr_t *uip_ds6_nbr_get_ipaddr(const uip_ds6_nbr_t *nbr); + +/** + * Get an IPv6 address associated with a specified link-layer address + * \param lladdr a link-layer address used as a search key + * \return the pointer to an IPv6 address associated with the neighbor cache + * \note This returns the first IPv6 address found in the neighbor + * cache when UIP_DS6_NBR_MULTI_IPV6_ADDRS is enabled + */ +uip_ipaddr_t *uip_ds6_nbr_ipaddr_from_lladdr(const uip_lladdr_t *lladdr); + +/** + * Get the neighbor cache associated with a specified IPv6 address + * \param ipaddr an IPv6 address used as a search key + * \return the pointer to a neighbor cache on success, NULL on failure + */ +uip_ds6_nbr_t *uip_ds6_nbr_lookup(const uip_ipaddr_t *ipaddr); + +/** + * Get the neighbor cache associated with a specified link-layer address + * \param lladdr a link-layer address used as a search key + * \return the pointer to a neighbor cache on success, NULL on failure + */ +uip_ds6_nbr_t *uip_ds6_nbr_ll_lookup(const uip_lladdr_t *lladdr); + +/** + * Return the number of neighbor caches + * \return the number of neighbor caches in use + */ int uip_ds6_nbr_num(void); + +/** + * Get the first neighbor cache in nbr_table + * \return the pointer to the first neighbor cache entry + */ uip_ds6_nbr_t *uip_ds6_nbr_head(void); + +/** + * Get the next neighbor cache of a specified one + * \param nbr the pointer to a neighbor cache + * \return the pointer to the next one on success, NULL on failure + */ uip_ds6_nbr_t *uip_ds6_nbr_next(uip_ds6_nbr_t *nbr); +/** + * The callback function to update link-layer stats in a neighbor + * cache + * \param status MAC return value defined in mac.h + * \param numtx the number of transmissions happened for a packet + */ +void uip_ds6_link_callback(int status, int numtx); + +/** + * The housekeeping function called periodically + */ +void uip_ds6_neighbor_periodic(void); + #if UIP_ND6_SEND_NS /** * \brief Refresh the reachable state of a neighbor. This function diff --git a/os/net/mac/csma/csma-output.c b/os/net/mac/csma/csma-output.c index 1773e0cb0..0436bacea 100644 --- a/os/net/mac/csma/csma-output.c +++ b/os/net/mac/csma/csma-output.c @@ -539,5 +539,4 @@ csma_output_init(void) memb_init(&packet_memb); memb_init(&metadata_memb); memb_init(&neighbor_memb); - queuebuf_init(); } diff --git a/os/net/mac/tsch/tsch-slot-operation.c b/os/net/mac/tsch/tsch-slot-operation.c index 841dee07f..a801bc92e 100644 --- a/os/net/mac/tsch/tsch-slot-operation.c +++ b/os/net/mac/tsch/tsch-slot-operation.c @@ -643,6 +643,8 @@ PT_THREAD(tsch_tx_slot(struct pt *pt, struct rtimer *t)) mac_tx_status = MAC_TX_ERR; } } + } else { + mac_tx_status = MAC_TX_ERR; } } diff --git a/os/net/mac/tsch/tsch.c b/os/net/mac/tsch/tsch.c index 25b565809..8a5218355 100644 --- a/os/net/mac/tsch/tsch.c +++ b/os/net/mac/tsch/tsch.c @@ -243,11 +243,49 @@ tsch_reset(void) } /* TSCH keep-alive functions */ +/*---------------------------------------------------------------------------*/ +/* Resynchronize to last_eb_nbr. + * Return non-zero if this function schedules the next keepalive. + * Return zero otherwise. + */ +static int +resynchronize(const linkaddr_t *original_time_source_addr) +{ + const struct tsch_neighbor *current_time_source = tsch_queue_get_time_source(); + if(current_time_source && !linkaddr_cmp(¤t_time_source->addr, original_time_source_addr)) { + /* Time source has already been changed (e.g. by RPL). Let's see if it works. */ + LOG_INFO("time source has been changed to "); + LOG_INFO_LLADDR(¤t_time_source->addr); + LOG_INFO_("\n"); + return 0; + } + /* Switch time source to the last neighbor we received an EB from */ + if(linkaddr_cmp(&last_eb_nbr_addr, &linkaddr_null)) { + LOG_WARN("not able to re-synchronize, received no EB from other neighbors\n"); + if(sync_count == 0) { + /* We got no synchronization at all in this session, leave the network */ + tsch_disassociate(); + } + return 0; + } else { + LOG_WARN("re-synchronizing on "); + LOG_WARN_LLADDR(&last_eb_nbr_addr); + LOG_WARN_("\n"); + /* We simply pick the last neighbor we receiver sync information from */ + tsch_queue_update_time_source(&last_eb_nbr_addr); + tsch_join_priority = last_eb_nbr_jp + 1; + /* Try to get in sync ASAP */ + tsch_schedule_keepalive_immediately(); + return 1; + } +} + /*---------------------------------------------------------------------------*/ /* Tx callback for keepalive messages */ static void keepalive_packet_sent(void *ptr, int status, int transmissions) { + int schedule_next_keepalive = 1; /* Update neighbor link statistics */ link_stats_packet_sent(packetbuf_addr(PACKETBUF_ADDR_RECEIVER), status, transmissions); /* Call RPL callback if RPL is enabled */ @@ -258,28 +296,14 @@ keepalive_packet_sent(void *ptr, int status, int transmissions) LOG_INFO_LLADDR(packetbuf_addr(PACKETBUF_ADDR_RECEIVER)); LOG_INFO_(", st %d-%d\n", status, transmissions); - /* We got no ack, try to recover by switching to the last neighbor we received an EB from */ + /* We got no ack, try to resynchronize */ if(status == MAC_TX_NOACK) { - if(linkaddr_cmp(&last_eb_nbr_addr, &linkaddr_null)) { - LOG_WARN("not able to re-synchronize, received no EB from other neighbors\n"); - if(sync_count == 0) { - /* We got no synchronization at all in this session, leave the network */ - tsch_disassociate(); - } - } else { - LOG_WARN("re-synchronizing on "); - LOG_WARN_LLADDR(&last_eb_nbr_addr); - LOG_WARN_("\n"); - /* We simply pick the last neighbor we receiver sync information from */ - tsch_queue_update_time_source(&last_eb_nbr_addr); - tsch_join_priority = last_eb_nbr_jp + 1; - /* Try to get in sync ASAP */ - tsch_schedule_keepalive_immediately(); - return; - } + schedule_next_keepalive = !resynchronize(packetbuf_addr(PACKETBUF_ADDR_RECEIVER)); } - tsch_schedule_keepalive(); + if(schedule_next_keepalive) { + tsch_schedule_keepalive(); + } } /*---------------------------------------------------------------------------*/ /* Prepare and send a keepalive message */ @@ -948,8 +972,7 @@ tsch_init(void) return; } - /* Init the queuebuf and TSCH sub-modules */ - queuebuf_init(); + /* Init TSCH sub-modules */ tsch_reset(); tsch_queue_init(); tsch_schedule_init(); diff --git a/os/net/queuebuf.h b/os/net/queuebuf.h index 60216465d..ef66da780 100644 --- a/os/net/queuebuf.h +++ b/os/net/queuebuf.h @@ -55,6 +55,12 @@ #include "net/packetbuf.h" +#ifdef QUEUEBUF_CONF_ENABLED +#define QUEUEBUF_ENABLED QUEUEBUF_CONF_ENABLED +#else /* QUEUEBUF_CONF_ENABLED */ +#define QUEUEBUF_ENABLED 1 +#endif /* QUEUEBUF_CONF_ENABLED */ + /* QUEUEBUF_NUM is the total number of queuebuf */ #ifdef QUEUEBUF_CONF_NUM #define QUEUEBUF_NUM QUEUEBUF_CONF_NUM diff --git a/os/net/routing/rpl-classic/rpl-dag.c b/os/net/routing/rpl-classic/rpl-dag.c index cbaee6959..58f758048 100644 --- a/os/net/routing/rpl-classic/rpl-dag.c +++ b/os/net/routing/rpl-classic/rpl-dag.c @@ -126,7 +126,7 @@ rpl_get_nbr(rpl_parent_t *parent) { const linkaddr_t *lladdr = rpl_get_parent_lladdr(parent); if(lladdr != NULL) { - return nbr_table_get_from_lladdr(ds6_neighbors, lladdr); + return uip_ds6_nbr_ll_lookup((const uip_lladdr_t *)lladdr); } else { return NULL; } @@ -145,9 +145,9 @@ rpl_dag_init(void) } /*---------------------------------------------------------------------------*/ rpl_parent_t * -rpl_get_parent(uip_lladdr_t *addr) +rpl_get_parent(const uip_lladdr_t *addr) { - rpl_parent_t *p = nbr_table_get_from_lladdr(rpl_parents, (linkaddr_t *)addr); + rpl_parent_t *p = nbr_table_get_from_lladdr(rpl_parents, (const linkaddr_t *)addr); return p; } /*---------------------------------------------------------------------------*/ diff --git a/os/net/routing/rpl-classic/rpl-nbr-policy.c b/os/net/routing/rpl-classic/rpl-nbr-policy.c index f6b26bae2..d23111e46 100644 --- a/os/net/routing/rpl-classic/rpl-nbr-policy.c +++ b/os/net/routing/rpl-classic/rpl-nbr-policy.c @@ -69,7 +69,7 @@ static int num_parents; /* any node that are possible parents */ static int num_children; /* all children that we have as nexthop */ static int num_free; -static linkaddr_t *worst_rank_nbr; /* the parent that has the worst rank */ +static const linkaddr_t *worst_rank_nbr; /* the parent that has the worst rank */ static rpl_rank_t worst_rank; /*---------------------------------------------------------------------------*/ #if LOG_DBG_ENABLED @@ -111,9 +111,9 @@ update_nbr(void) num_parents = 0; num_children = 0; - nbr = nbr_table_head(ds6_neighbors); + nbr = uip_ds6_nbr_head(); while(nbr != NULL) { - linkaddr_t *lladdr = nbr_table_get_lladdr(ds6_neighbors, nbr); + const linkaddr_t *lladdr = (const linkaddr_t *)uip_ds6_nbr_get_ll(nbr); is_used = 0; /* @@ -126,7 +126,7 @@ update_nbr(void) num_children++; } - parent = rpl_get_parent((uip_lladdr_t *)lladdr); + parent = rpl_get_parent((const uip_lladdr_t *)lladdr); if(parent != NULL) { num_parents++; @@ -158,7 +158,7 @@ update_nbr(void) LOG_DBG_("\n"); } - nbr = nbr_table_next(ds6_neighbors, nbr); + nbr = uip_ds6_nbr_next(nbr); num_used++; } /* how many more IP neighbors can be have? */ diff --git a/os/net/routing/rpl-classic/rpl.h b/os/net/routing/rpl-classic/rpl.h index f0c17cac9..e690abeae 100644 --- a/os/net/routing/rpl-classic/rpl.h +++ b/os/net/routing/rpl-classic/rpl.h @@ -285,7 +285,7 @@ uint16_t rpl_get_parent_link_metric(rpl_parent_t *p); rpl_rank_t rpl_rank_via_parent(rpl_parent_t *p); const linkaddr_t *rpl_get_parent_lladdr(rpl_parent_t *p); uip_ipaddr_t *rpl_parent_get_ipaddr(rpl_parent_t *nbr); -rpl_parent_t *rpl_get_parent(uip_lladdr_t *addr); +rpl_parent_t *rpl_get_parent(const uip_lladdr_t *addr); rpl_rank_t rpl_get_parent_rank(uip_lladdr_t *addr); void rpl_dag_init(void); uip_ds6_nbr_t *rpl_get_nbr(rpl_parent_t *parent); diff --git a/os/net/routing/rpl-lite/rpl-nbr-policy.c b/os/net/routing/rpl-lite/rpl-nbr-policy.c index 0c542f780..188ceb648 100644 --- a/os/net/routing/rpl-lite/rpl-nbr-policy.c +++ b/os/net/routing/rpl-lite/rpl-nbr-policy.c @@ -62,7 +62,7 @@ static int num_parents; /* all nodes that are possible parents */ static int num_free; -static linkaddr_t *worst_rank_nbr_lladdr; /* lladdr of the the neighbor with the worst rank */ +static const linkaddr_t *worst_rank_nbr_lladdr; /* lladdr of the the neighbor with the worst rank */ static rpl_rank_t worst_rank; /*---------------------------------------------------------------------------*/ @@ -78,10 +78,10 @@ update_state(void) worst_rank_nbr_lladdr = NULL; num_parents = 0; - ds6_nbr = nbr_table_head(ds6_neighbors); + ds6_nbr = uip_ds6_nbr_head(); while(ds6_nbr != NULL) { - linkaddr_t *nbr_lladdr = nbr_table_get_lladdr(ds6_neighbors, ds6_nbr); + const linkaddr_t *nbr_lladdr = (const linkaddr_t *)uip_ds6_nbr_get_ll(ds6_nbr); rpl_nbr = rpl_neighbor_get_from_lladdr((uip_lladdr_t *)nbr_lladdr); if(rpl_nbr != NULL && rpl_neighbor_is_parent(rpl_nbr)) { @@ -97,7 +97,7 @@ update_state(void) worst_rank_nbr_lladdr = nbr_lladdr; } - ds6_nbr = nbr_table_next(ds6_neighbors, ds6_nbr); + ds6_nbr = uip_ds6_nbr_next(ds6_nbr); num_used++; } /* how many more IP neighbors can be have? */ diff --git a/os/net/routing/rpl-lite/rpl-neighbor.c b/os/net/routing/rpl-lite/rpl-neighbor.c index a0f5d95b0..94a26fe75 100644 --- a/os/net/routing/rpl-lite/rpl-neighbor.c +++ b/os/net/routing/rpl-lite/rpl-neighbor.c @@ -181,9 +181,9 @@ rpl_neighbor_count(void) static uip_ds6_nbr_t * rpl_get_ds6_nbr(rpl_nbr_t *nbr) { - const linkaddr_t *lladdr = rpl_neighbor_get_lladdr(nbr); + const uip_lladdr_t *lladdr = (const uip_lladdr_t *)rpl_neighbor_get_lladdr(nbr); if(lladdr != NULL) { - return nbr_table_get_from_lladdr(ds6_neighbors, lladdr); + return uip_ds6_nbr_ll_lookup(lladdr); } else { return NULL; } diff --git a/tests/02-compile-arm-ports-01/Makefile b/tests/02-compile-arm-ports-01/Makefile index aaebab164..43e008c8e 100644 --- a/tests/02-compile-arm-ports-01/Makefile +++ b/tests/02-compile-arm-ports-01/Makefile @@ -2,41 +2,41 @@ EXAMPLESDIR=../../examples TOOLSDIR=../../tools EXAMPLES = \ -platform-specific/cc26xx/cc26xx-web-demo/srf06-cc26xx \ -platform-specific/cc26xx/cc26xx-web-demo/srf06-cc26xx:MAKE_ROUTING=MAKE_ROUTING_RPL_CLASSIC \ -platform-specific/cc26xx/very-sleepy-demo/srf06-cc26xx:BOARD=sensortag/cc2650 \ -platform-specific/cc26xx/cc26xx-web-demo/srf06-cc26xx:BOARD=sensortag/cc2650 \ -platform-specific/cc26xx/cc26xx-web-demo/srf06-cc26xx:BOARD=sensortag/cc1350 \ -platform-specific/cc26xx/cc26xx-web-demo/srf06-cc26xx:BOARD=srf06/cc13xx \ -platform-specific/cc26xx/cc26xx-web-demo/srf06-cc26xx:BOARD=launchpad/cc2650 \ -platform-specific/cc26xx/cc26xx-web-demo/srf06-cc26xx:BOARD=launchpad/cc1310 \ -platform-specific/cc26xx/cc26xx-web-demo/srf06-cc26xx:BOARD=launchpad/cc1350 \ -platform-specific/cc26xx/very-sleepy-demo/srf06-cc26xx \ -platform-specific/cc26xx/ble-ipv6/srf06-cc26xx:BOARD=sensortag/cc2650 \ -nullnet/srf06-cc26xx:BOARD=sensortag/cc2650 \ -rpl-border-router/srf06-cc26xx:BOARD=launchpad/cc2650 \ -sensniff/srf06-cc26xx \ -sensniff/srf06-cc26xx:BOARD=launchpad/cc1310 \ -dev/gpio-hal/srf06-cc26xx:BOARD=srf06/cc13xx \ -dev/gpio-hal/srf06-cc26xx:BOARD=srf06/cc26xx \ -dev/gpio-hal/srf06-cc26xx:BOARD=sensortag/cc1350 \ -dev/gpio-hal/srf06-cc26xx:BOARD=sensortag/cc2650 \ -dev/gpio-hal/srf06-cc26xx:BOARD=launchpad/cc1310 \ -dev/gpio-hal/srf06-cc26xx:BOARD=launchpad/cc1350 \ -dev/gpio-hal/srf06-cc26xx:BOARD=launchpad/cc2650 \ -dev/gpio-hal/srf06-cc26xx:BOARD=launchpad/cc2640r2 \ -dev/leds/srf06-cc26xx:BOARD=srf06/cc13xx \ -dev/leds/srf06-cc26xx:BOARD=srf06/cc26xx \ -dev/leds/srf06-cc26xx:BOARD=sensortag/cc1350 \ -dev/leds/srf06-cc26xx:BOARD=sensortag/cc2650 \ -dev/leds/srf06-cc26xx:BOARD=launchpad/cc1310 \ -dev/leds/srf06-cc26xx:BOARD=launchpad/cc1350 \ -dev/leds/srf06-cc26xx:BOARD=launchpad/cc2650 \ -dev/leds/srf06-cc26xx:BOARD=launchpad/cc2640r2 \ -6tisch/etsi-plugtest-2017/srf06-cc26xx:BOARD=launchpad/cc2650 \ -mqtt-client/srf06-cc26xx:BOARD=srf06/cc26xx \ -mqtt-client/srf06-cc26xx:BOARD=launchpad/cc2650 \ -mqtt-client/srf06-cc26xx:BOARD=sensortag/cc2650 \ +platform-specific/cc26x0-cc13x0/cc26x0-web-demo/cc26x0-cc13x0 \ +platform-specific/cc26x0-cc13x0/cc26x0-web-demo/cc26x0-cc13x0:MAKE_ROUTING=MAKE_ROUTING_RPL_CLASSIC \ +platform-specific/cc26x0-cc13x0/very-sleepy-demo/cc26x0-cc13x0:BOARD=sensortag/cc2650 \ +platform-specific/cc26x0-cc13x0/cc26x0-web-demo/cc26x0-cc13x0:BOARD=sensortag/cc2650 \ +platform-specific/cc26x0-cc13x0/cc26x0-web-demo/cc26x0-cc13x0:BOARD=sensortag/cc1350 \ +platform-specific/cc26x0-cc13x0/cc26x0-web-demo/cc26x0-cc13x0:BOARD=srf06/cc13x0 \ +platform-specific/cc26x0-cc13x0/cc26x0-web-demo/cc26x0-cc13x0:BOARD=launchpad/cc2650 \ +platform-specific/cc26x0-cc13x0/cc26x0-web-demo/cc26x0-cc13x0:BOARD=launchpad/cc1310 \ +platform-specific/cc26x0-cc13x0/cc26x0-web-demo/cc26x0-cc13x0:BOARD=launchpad/cc1350 \ +platform-specific/cc26x0-cc13x0/very-sleepy-demo/cc26x0-cc13x0 \ +platform-specific/cc26x0-cc13x0/ble-ipv6/cc26x0-cc13x0:BOARD=sensortag/cc2650 \ +nullnet/cc26x0-cc13x0:BOARD=sensortag/cc2650 \ +rpl-border-router/cc26x0-cc13x0:BOARD=launchpad/cc2650 \ +sensniff/cc26x0-cc13x0 \ +sensniff/cc26x0-cc13x0:BOARD=launchpad/cc1310 \ +dev/gpio-hal/cc26x0-cc13x0:BOARD=srf06/cc13x0 \ +dev/gpio-hal/cc26x0-cc13x0:BOARD=srf06/cc26x0 \ +dev/gpio-hal/cc26x0-cc13x0:BOARD=sensortag/cc1350 \ +dev/gpio-hal/cc26x0-cc13x0:BOARD=sensortag/cc2650 \ +dev/gpio-hal/cc26x0-cc13x0:BOARD=launchpad/cc1310 \ +dev/gpio-hal/cc26x0-cc13x0:BOARD=launchpad/cc1350 \ +dev/gpio-hal/cc26x0-cc13x0:BOARD=launchpad/cc2650 \ +dev/gpio-hal/cc26x0-cc13x0:BOARD=launchpad/cc2640r2 \ +dev/leds/cc26x0-cc13x0:BOARD=srf06/cc13x0 \ +dev/leds/cc26x0-cc13x0:BOARD=srf06/cc26x0 \ +dev/leds/cc26x0-cc13x0:BOARD=sensortag/cc1350 \ +dev/leds/cc26x0-cc13x0:BOARD=sensortag/cc2650 \ +dev/leds/cc26x0-cc13x0:BOARD=launchpad/cc1310 \ +dev/leds/cc26x0-cc13x0:BOARD=launchpad/cc1350 \ +dev/leds/cc26x0-cc13x0:BOARD=launchpad/cc2650 \ +dev/leds/cc26x0-cc13x0:BOARD=launchpad/cc2640r2 \ +6tisch/etsi-plugtest-2017/cc26x0-cc13x0:BOARD=launchpad/cc2650 \ +mqtt-client/cc26x0-cc13x0:BOARD=srf06/cc26x0 \ +mqtt-client/cc26x0-cc13x0:BOARD=launchpad/cc2650 \ +mqtt-client/cc26x0-cc13x0:BOARD=sensortag/cc2650 \ hello-world/simplelink:BOARD=launchpad/cc26x2r1 \ hello-world/simplelink:BOARD=sensortag/cc2650 \ nullnet/simplelink:BOARD=sensortag/cc2650 \ diff --git a/tests/08-native-runs/02-mqtt-client.sh b/tests/08-native-runs/02-mqtt-client.sh new file mode 100755 index 000000000..cb1ee937a --- /dev/null +++ b/tests/08-native-runs/02-mqtt-client.sh @@ -0,0 +1,79 @@ +#!/bin/bash +source ../utils.sh + +# Contiki directory +CONTIKI=$1 + +# Example code directory +CODE_DIR=$CONTIKI/examples/mqtt-client/ +CODE=mqtt-client + +CLIENT_LOG=$CODE.log +CLIENT_TESTLOG=$CODE.testlog +CLIENT_ERR=$CODE.err +MOSQ_SUB_LOG=mosquitto_sub.log +MOSQ_SUB_ERR=mosquitto_sub.err + +# Start mosquitto server +echo "Starting mosquitto daemon" +mosquitto &> /dev/null & +MOSQID=$! +sleep 2 + +# Start mosquitto_sub client. Subscribe +echo "Starting mosquitto subscriber" +mosquitto_sub -t iot-2/evt/status/fmt/json > $MOSQ_SUB_LOG 2> $MOSQ_SUB_ERR & +MSUBID=$! +sleep 2 + +# Starting Contiki-NG native node +echo "Starting native node" +make -C $CODE_DIR TARGET=native \ + DEFINES=MQTT_CLIENT_CONF_ORG_ID=\\\"travis-test\\\",MQTT_CLIENT_CONF_LOG_LEVEL=LOG_LEVEL_DBG \ + > make.log 2> make.err +sudo $CODE_DIR/$CODE.native > $CLIENT_LOG 2> $CLIENT_ERR & +CPID=$! + +# The mqtt-client will publish every 30 secs. Wait for 45 +sleep 45 + +# Send a publish to the mqtt client +mosquitto_pub -m "1" -t iot-2/cmd/leds/fmt/json + +echo "Closing native node" +sleep 2 +kill_bg $CPID + +echo "Stopping mosquitto daemon" +kill_bg $MOSQID + +echo "Stopping mosquitto subscriber" +kill_bg $MSUBID + +# Success criteria: +# * mosquitto_sub output not empty +# * mqtt-client.native output contains "MQTT SUB" +SUB_RCV=`grep "MQTT SUB" $CLIENT_LOG` +if [ -s "$MOSQ_SUB_LOG" -a -n "$SUB_RCV" ] +then + cp $CLIENT_LOG $CODE.testlog + printf "%-32s TEST OK\n" "$CODE" | tee $CODE.testlog; +else + echo "==== make.log ====" ; cat make.log; + echo "==== make.err ====" ; cat make.err; + echo "==== $CLIENT_LOG ====" ; cat $CLIENT_LOG; + echo "==== $CLIENT_ERR ====" ; cat $CLIENT_ERR; + echo "==== $MOSQ_SUB_LOG ====" ; cat $MOSQ_SUB_LOG; + echo "==== $MOSQ_SUB_ERR ====" ; cat $MOSQ_SUB_ERR; + + printf "%-32s TEST FAIL\n" "$CODE" | tee $CODE.testlog; +fi + +rm make.log +rm make.err +rm $CLIENT_LOG $CLIENT_ERR +rm $MOSQ_SUB_LOG $MOSQ_SUB_ERR + +# We do not want Make to stop -> Return 0 +# The Makefile will check if a log contains FAIL at the end +exit 0 diff --git a/tests/09-ipv6/09-ping-lla-ula-csma-w-rpl.csc b/tests/09-ipv6/09-ping-lla-ula-csma-w-rpl.csc new file mode 100644 index 000000000..66e2a8c9a --- /dev/null +++ b/tests/09-ipv6/09-ping-lla-ula-csma-w-rpl.csc @@ -0,0 +1,108 @@ + + + [APPS_DIR]/mrm + [APPS_DIR]/mspsim + [APPS_DIR]/avrora + [APPS_DIR]/serial_socket + [APPS_DIR]/powertracker + + My simulation + 1.0 + 123456 + 1000000 + + org.contikios.cooja.radiomediums.UDGM + 50.0 + 100.0 + 1.0 + 1.0 + + + 40000 + + + org.contikios.cooja.contikimote.ContikiMoteType + mtype787 + Cooja Mote Type #1 + [CONTIKI_DIR]/tests/09-ipv6/code/node.c + make clean + make WITH_ULA=1 WITH_CSMA=1 node.cooja + org.contikios.cooja.interfaces.Position + org.contikios.cooja.interfaces.Battery + org.contikios.cooja.contikimote.interfaces.ContikiVib + org.contikios.cooja.contikimote.interfaces.ContikiMoteID + org.contikios.cooja.contikimote.interfaces.ContikiRS232 + org.contikios.cooja.contikimote.interfaces.ContikiBeeper + org.contikios.cooja.interfaces.RimeAddress + org.contikios.cooja.contikimote.interfaces.ContikiIPAddress + org.contikios.cooja.contikimote.interfaces.ContikiRadio + org.contikios.cooja.contikimote.interfaces.ContikiButton + org.contikios.cooja.contikimote.interfaces.ContikiPIR + org.contikios.cooja.contikimote.interfaces.ContikiClock + org.contikios.cooja.contikimote.interfaces.ContikiLED + org.contikios.cooja.contikimote.interfaces.ContikiCFS + org.contikios.cooja.contikimote.interfaces.ContikiEEPROM + org.contikios.cooja.interfaces.Mote2MoteRelations + org.contikios.cooja.interfaces.MoteAttributes + false + + + + org.contikios.cooja.interfaces.Position + 14.03051207883138 + 82.02801380504546 + 0.0 + + + org.contikios.cooja.contikimote.interfaces.ContikiMoteID + 1 + + + org.contikios.cooja.contikimote.interfaces.ContikiRS232 + ip-nbr~;ping fe80::202:2:2:2~;ip-nbr~;help~;je;p~;ping da~;ping~;help~; + + + org.contikios.cooja.contikimote.interfaces.ContikiRadio + 250.0 + + + org.contikios.cooja.contikimote.interfaces.ContikiEEPROM + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA== + + mtype787 + + + + org.contikios.cooja.interfaces.Position + 28.22612889898729 + 43.60027658221718 + 0.0 + + + org.contikios.cooja.contikimote.interfaces.ContikiMoteID + 2 + + + org.contikios.cooja.contikimote.interfaces.ContikiRadio + 250.0 + + + org.contikios.cooja.contikimote.interfaces.ContikiEEPROM + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA== + + mtype787 + + + + org.contikios.cooja.plugins.ScriptRunner + + [CONTIKI_DIR]/tests/09-ipv6/js/ping-test-lla-ula.js + true + + 495 + 0 + 525 + 190 + 18 + + diff --git a/tests/09-ipv6/10-ping-lla-ula-tsch-w-rpl.csc b/tests/09-ipv6/10-ping-lla-ula-tsch-w-rpl.csc new file mode 100644 index 000000000..e6957af28 --- /dev/null +++ b/tests/09-ipv6/10-ping-lla-ula-tsch-w-rpl.csc @@ -0,0 +1,108 @@ + + + [APPS_DIR]/mrm + [APPS_DIR]/mspsim + [APPS_DIR]/avrora + [APPS_DIR]/serial_socket + [APPS_DIR]/powertracker + + My simulation + 1.0 + 123456 + 1000000 + + org.contikios.cooja.radiomediums.UDGM + 50.0 + 100.0 + 1.0 + 1.0 + + + 40000 + + + org.contikios.cooja.contikimote.ContikiMoteType + mtype787 + Cooja Mote Type #1 + [CONTIKI_DIR]/tests/09-ipv6/code/node.c + make clean + make WITH_ULA=1 WITH_TSCH=1 node.cooja + org.contikios.cooja.interfaces.Position + org.contikios.cooja.interfaces.Battery + org.contikios.cooja.contikimote.interfaces.ContikiVib + org.contikios.cooja.contikimote.interfaces.ContikiMoteID + org.contikios.cooja.contikimote.interfaces.ContikiRS232 + org.contikios.cooja.contikimote.interfaces.ContikiBeeper + org.contikios.cooja.interfaces.RimeAddress + org.contikios.cooja.contikimote.interfaces.ContikiIPAddress + org.contikios.cooja.contikimote.interfaces.ContikiRadio + org.contikios.cooja.contikimote.interfaces.ContikiButton + org.contikios.cooja.contikimote.interfaces.ContikiPIR + org.contikios.cooja.contikimote.interfaces.ContikiClock + org.contikios.cooja.contikimote.interfaces.ContikiLED + org.contikios.cooja.contikimote.interfaces.ContikiCFS + org.contikios.cooja.contikimote.interfaces.ContikiEEPROM + org.contikios.cooja.interfaces.Mote2MoteRelations + org.contikios.cooja.interfaces.MoteAttributes + false + + + + org.contikios.cooja.interfaces.Position + 14.03051207883138 + 82.02801380504546 + 0.0 + + + org.contikios.cooja.contikimote.interfaces.ContikiMoteID + 1 + + + org.contikios.cooja.contikimote.interfaces.ContikiRS232 + ip-nbr~;ping fe80::202:2:2:2~;ip-nbr~;help~;je;p~;ping da~;ping~;help~; + + + org.contikios.cooja.contikimote.interfaces.ContikiRadio + 250.0 + + + org.contikios.cooja.contikimote.interfaces.ContikiEEPROM + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA== + + mtype787 + + + + org.contikios.cooja.interfaces.Position + 28.22612889898729 + 43.60027658221718 + 0.0 + + + org.contikios.cooja.contikimote.interfaces.ContikiMoteID + 2 + + + org.contikios.cooja.contikimote.interfaces.ContikiRadio + 250.0 + + + org.contikios.cooja.contikimote.interfaces.ContikiEEPROM + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA== + + mtype787 + + + + org.contikios.cooja.plugins.ScriptRunner + + [CONTIKI_DIR]/tests/09-ipv6/js/ping-test-lla-ula.js + true + + 495 + 0 + 525 + 190 + 18 + + diff --git a/tests/09-ipv6/11-ping-lla-ula-csma-wo-rpl.csc b/tests/09-ipv6/11-ping-lla-ula-csma-wo-rpl.csc new file mode 100644 index 000000000..b95a1ff4b --- /dev/null +++ b/tests/09-ipv6/11-ping-lla-ula-csma-wo-rpl.csc @@ -0,0 +1,108 @@ + + + [APPS_DIR]/mrm + [APPS_DIR]/mspsim + [APPS_DIR]/avrora + [APPS_DIR]/serial_socket + [APPS_DIR]/powertracker + + My simulation + 1.0 + 123456 + 1000000 + + org.contikios.cooja.radiomediums.UDGM + 50.0 + 100.0 + 1.0 + 1.0 + + + 40000 + + + org.contikios.cooja.contikimote.ContikiMoteType + mtype787 + Cooja Mote Type #1 + [CONTIKI_DIR]/tests/09-ipv6/code/node.c + make clean + make WITH_NBR_MULTI_IPV6_ADDRS=1 WITH_ULA=1 WITH_CSMA=1 WITHOUT_RPL=1 node.cooja + org.contikios.cooja.interfaces.Position + org.contikios.cooja.interfaces.Battery + org.contikios.cooja.contikimote.interfaces.ContikiVib + org.contikios.cooja.contikimote.interfaces.ContikiMoteID + org.contikios.cooja.contikimote.interfaces.ContikiRS232 + org.contikios.cooja.contikimote.interfaces.ContikiBeeper + org.contikios.cooja.interfaces.RimeAddress + org.contikios.cooja.contikimote.interfaces.ContikiIPAddress + org.contikios.cooja.contikimote.interfaces.ContikiRadio + org.contikios.cooja.contikimote.interfaces.ContikiButton + org.contikios.cooja.contikimote.interfaces.ContikiPIR + org.contikios.cooja.contikimote.interfaces.ContikiClock + org.contikios.cooja.contikimote.interfaces.ContikiLED + org.contikios.cooja.contikimote.interfaces.ContikiCFS + org.contikios.cooja.contikimote.interfaces.ContikiEEPROM + org.contikios.cooja.interfaces.Mote2MoteRelations + org.contikios.cooja.interfaces.MoteAttributes + false + + + + org.contikios.cooja.interfaces.Position + 14.03051207883138 + 82.02801380504546 + 0.0 + + + org.contikios.cooja.contikimote.interfaces.ContikiMoteID + 1 + + + org.contikios.cooja.contikimote.interfaces.ContikiRS232 + ip-nbr~;ping fe80::202:2:2:2~;ip-nbr~;help~;je;p~;ping da~;ping~;help~; + + + org.contikios.cooja.contikimote.interfaces.ContikiRadio + 250.0 + + + org.contikios.cooja.contikimote.interfaces.ContikiEEPROM + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA== + + mtype787 + + + + org.contikios.cooja.interfaces.Position + 28.22612889898729 + 43.60027658221718 + 0.0 + + + org.contikios.cooja.contikimote.interfaces.ContikiMoteID + 2 + + + org.contikios.cooja.contikimote.interfaces.ContikiRadio + 250.0 + + + org.contikios.cooja.contikimote.interfaces.ContikiEEPROM + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA== + + mtype787 + + + + org.contikios.cooja.plugins.ScriptRunner + + [CONTIKI_DIR]/tests/09-ipv6/js/ping-test-lla-ula.js + true + + 495 + 0 + 525 + 190 + 18 + + diff --git a/tests/09-ipv6/12-ping-lla-ula-tsch-wo-rpl.csc b/tests/09-ipv6/12-ping-lla-ula-tsch-wo-rpl.csc new file mode 100644 index 000000000..20f8a12ae --- /dev/null +++ b/tests/09-ipv6/12-ping-lla-ula-tsch-wo-rpl.csc @@ -0,0 +1,108 @@ + + + [APPS_DIR]/mrm + [APPS_DIR]/mspsim + [APPS_DIR]/avrora + [APPS_DIR]/serial_socket + [APPS_DIR]/powertracker + + My simulation + 1.0 + 123456 + 1000000 + + org.contikios.cooja.radiomediums.UDGM + 50.0 + 100.0 + 1.0 + 1.0 + + + 40000 + + + org.contikios.cooja.contikimote.ContikiMoteType + mtype787 + Cooja Mote Type #1 + [CONTIKI_DIR]/tests/09-ipv6/code/node.c + make clean + make WITH_NBR_MULTI_IPV6_ADDRS=1 WITH_ULA=1 WITH_TSCH=1 WITHOUT_RPL=1 node.cooja + org.contikios.cooja.interfaces.Position + org.contikios.cooja.interfaces.Battery + org.contikios.cooja.contikimote.interfaces.ContikiVib + org.contikios.cooja.contikimote.interfaces.ContikiMoteID + org.contikios.cooja.contikimote.interfaces.ContikiRS232 + org.contikios.cooja.contikimote.interfaces.ContikiBeeper + org.contikios.cooja.interfaces.RimeAddress + org.contikios.cooja.contikimote.interfaces.ContikiIPAddress + org.contikios.cooja.contikimote.interfaces.ContikiRadio + org.contikios.cooja.contikimote.interfaces.ContikiButton + org.contikios.cooja.contikimote.interfaces.ContikiPIR + org.contikios.cooja.contikimote.interfaces.ContikiClock + org.contikios.cooja.contikimote.interfaces.ContikiLED + org.contikios.cooja.contikimote.interfaces.ContikiCFS + org.contikios.cooja.contikimote.interfaces.ContikiEEPROM + org.contikios.cooja.interfaces.Mote2MoteRelations + org.contikios.cooja.interfaces.MoteAttributes + false + + + + org.contikios.cooja.interfaces.Position + 14.03051207883138 + 82.02801380504546 + 0.0 + + + org.contikios.cooja.contikimote.interfaces.ContikiMoteID + 1 + + + org.contikios.cooja.contikimote.interfaces.ContikiRS232 + ip-nbr~;ping fe80::202:2:2:2~;ip-nbr~;help~;je;p~;ping da~;ping~;help~; + + + org.contikios.cooja.contikimote.interfaces.ContikiRadio + 250.0 + + + org.contikios.cooja.contikimote.interfaces.ContikiEEPROM + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA== + + mtype787 + + + + org.contikios.cooja.interfaces.Position + 28.22612889898729 + 43.60027658221718 + 0.0 + + + org.contikios.cooja.contikimote.interfaces.ContikiMoteID + 2 + + + org.contikios.cooja.contikimote.interfaces.ContikiRadio + 250.0 + + + org.contikios.cooja.contikimote.interfaces.ContikiEEPROM + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA== + + mtype787 + + + + org.contikios.cooja.plugins.ScriptRunner + + [CONTIKI_DIR]/tests/09-ipv6/js/ping-test-lla-ula.js + true + + 495 + 0 + 525 + 190 + 18 + + diff --git a/tests/09-ipv6/code/Makefile b/tests/09-ipv6/code/Makefile index 2c910f1cd..d8f4cab55 100644 --- a/tests/09-ipv6/code/Makefile +++ b/tests/09-ipv6/code/Makefile @@ -28,6 +28,10 @@ ifeq ($(WITH_TSCH),1) CFLAGS += -DTSCH_CONF_DEFAULT_HOPPING_SEQUENCE=TSCH_HOPPING_SEQUENCE_1_1 endif +ifeq ($(WITH_NBR_MULTI_IPV6_ADDRS),1) + CFLAGS += -DUIP_DS6_NBR_CONF_MULTI_IPV6_ADDRS=1 +endif + PLATFORM_ONLY = cooja TARGET = cooja diff --git a/tests/09-ipv6/js/ping-test-lla-ula.js b/tests/09-ipv6/js/ping-test-lla-ula.js new file mode 100644 index 000000000..c15dcbf15 --- /dev/null +++ b/tests/09-ipv6/js/ping-test-lla-ula.js @@ -0,0 +1,72 @@ +TIMEOUT(20000, log.testFailed()); + +dst_lla = "fe80::202:2:2:2"; +dst_ula = "fd00::202:2:2:2"; +dst_mac = "0002.0002.0002.0002"; +step = 0; +rpl_is_enabled = false; + +while(1) { + YIELD(); + log.log(time + " " + id + " "+ msg + "\n"); + + if(msg.contains("Node ID: ")) { + if(id == 1) { + write(sim.getMoteWithID(1), "rpl-set-root 1"); + } + step += 1; + } + + if(msg.contains("Setting as DAG root")) { + rpl_is_enabled = true; + } + + if(step == 2 && time > 15000000) { + write(sim.getMoteWithID(1), "ping " + dst_lla); + step += 1; + } + + if(step == 4 && time > 15000000) { + write(sim.getMoteWithID(1), "ping " + dst_ula); + step += 1; + } + + if(msg.contains("Received ping reply")) { + if(step == 3) { + step += 1; + } else { + step += 1; + write(sim.getMoteWithID(1), "ip-nbr"); + } + } + + if(step == 6 && rpl_is_enabled) { + /* when RPL is enabled, we skip examining ip-nbr results */ + log.testOK(); + } + + if(msg.contains("<->")) { + re = /-- | <-> |, router|, state /; + nc = msg.split(re); + ip_addr = nc[1]; + ll_addr = nc[2]; + is_router = nc[3]; + state = nc[4].trim(); + if(ll_addr == dst_mac && + state == "Reachable") { + if(step == 6 && ip_addr == dst_lla) { + step += 1; + } else if(step == 7 && ip_addr == dst_ula) { + log.testOK(); + } else { + /* unexpected case */ + log.testFailed(); + } + } else { + log.log(ip_addr + "\n"); + log.log(ll_addr + "\n"); + log.log(state + "\n"); + log.testFailed(); + } + } +} diff --git a/tests/10-ipv6-nbr/01-test-nbr-multi-addrs.sh b/tests/10-ipv6-nbr/01-test-nbr-multi-addrs.sh new file mode 100755 index 000000000..8f73ee237 --- /dev/null +++ b/tests/10-ipv6-nbr/01-test-nbr-multi-addrs.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +TEST_NAME=01-test-nbr-multi-addrs + +if [ $# -eq 1 ]; then + # a (relative) path to CONTIKI_DIR is supposed to be given as $1 + TEST_DIR=$1/tests/10-ipv6-nbr +else + TEST_DIR=.//tests/10-ipv6-nbr +fi +SRC_DIR=${TEST_DIR}/nbr-multi-addrs +EXEC_FILE_NAME=test.native + +make -C ${SRC_DIR} clean + +echo "build the test program"... +make -C ${SRC_DIR} > ${TEST_NAME}.log + +echo "run the test..." +${TEST_DIR}/${SRC_DIR}/${EXEC_FILE_NAME} | tee ${TEST_NAME}.log | \ + grep -vE '^\[' >> ${TEST_NAME}.testlog diff --git a/tests/10-ipv6-nbr/Makefile b/tests/10-ipv6-nbr/Makefile new file mode 100644 index 000000000..c46e5271d --- /dev/null +++ b/tests/10-ipv6-nbr/Makefile @@ -0,0 +1 @@ +include ../Makefile.script-test diff --git a/tests/10-ipv6-nbr/nbr-multi-addrs/Makefile b/tests/10-ipv6-nbr/nbr-multi-addrs/Makefile new file mode 100644 index 000000000..711bf0987 --- /dev/null +++ b/tests/10-ipv6-nbr/nbr-multi-addrs/Makefile @@ -0,0 +1,14 @@ +CONTIKI_PROJECT = test +all: $(CONTIKI_PROJECT) + +CFLAGS += -DUNIT_TEST_PRINT_FUNCTION=my_test_print +CFLAGS += -DLOG_CONF_LEVEL_IPV6=LOG_LEVEL_DBG +CFLAGS += -DNBR_TABLE_FIND_REMOVABLE=my_always_return_null +CFLAGS += -DUIP_DS6_NBR_CONF_MULTI_IPV6_ADDRS=1 + +PLATFORM_ONLY = native +TARGET = native +MODULES += os/sys/log os/services/unit-test + +CONTIKI = ../../../ +include $(CONTIKI)/Makefile.include diff --git a/tests/10-ipv6-nbr/nbr-multi-addrs/test.c b/tests/10-ipv6-nbr/nbr-multi-addrs/test.c new file mode 100644 index 000000000..2cefd7cca --- /dev/null +++ b/tests/10-ipv6-nbr/nbr-multi-addrs/test.c @@ -0,0 +1,260 @@ +/* + * Copyright (c) 2018, Yasuyuki Tanaka + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright +* notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include +#include +#include +#include +#include + +#include + +#define LOG_MODULE "test" +#define LOG_LEVEL LOG_LEVEL_DBG + +/* report function defined in unit-test.c */ +void unit_test_print_report(const unit_test_t *utp); + +static const uint8_t is_router = 1; +static const uint8_t state = NBR_INCOMPLETE; +static const nbr_table_reason_t reason = NBR_TABLE_REASON_UNDEFINED; + +static void remove_all_entries_in_neighbor_cache(void); + +PROCESS(node_process, "Node"); +AUTOSTART_PROCESSES(&node_process); + +void +my_test_print(const unit_test_t *utp) +{ + unit_test_print_report(utp); + if(utp->result == unit_test_failure) { + printf("\nTEST FAILED\n"); + exit(1); /* exit by failure */ + } +} + +/* my_always_return_null() is set to NBR_TABLE_FIND_REMOVABLE */ +const linkaddr_t * +my_always_return_null(nbr_table_reason_t reason, void *data) +{ + return NULL; +} + +void +remove_all_entries_in_neighbor_cache(void) +{ + uip_ds6_nbr_t *nbr, *next_nbr; + for(nbr = uip_ds6_nbr_head(); nbr != NULL; nbr = next_nbr) { + next_nbr = uip_ds6_nbr_next(nbr); + uip_ds6_nbr_rm(nbr); + } + /* + * uip_ds6_nbr_rm() cannot free the memory for an entry in nbr-table. There is + * no API to free or deallocate unused nbr-table entry. Because of that, + * nbr-table has some link-layer addresses even though this function removes + * all the neighbor cache entries. + */ +} + +UNIT_TEST_REGISTER(add_v6addrs_to_neighbor, + "add IPv6 addresses to a single neighbor"); +UNIT_TEST(add_v6addrs_to_neighbor) +{ + uip_ipaddr_t ipaddr; + uip_lladdr_t lladdr; + uip_ds6_nbr_t *nbr; + const uip_lladdr_t *ret_lladdr; + + memset(&ipaddr, 0, sizeof(ipaddr)); + memset(&lladdr, 0, sizeof(lladdr)); + + UNIT_TEST_BEGIN(); + + /* make sure the neighbor cache table is empty */ + remove_all_entries_in_neighbor_cache(); + UNIT_TEST_ASSERT(uip_ds6_nbr_head() == NULL); + UNIT_TEST_ASSERT(uip_ds6_nbr_num() == 0); + + /* prepare a link-layer address */ + LOG_DBG("link-layer addr: "); + LOG_DBG_LLADDR((const linkaddr_t *)&lladdr); + LOG_DBG_("\n"); + + for(int i = 0; i <= UIP_DS6_NBR_MAX_6ADDRS_PER_NBR; i++) { + ipaddr.u8[0] = i; + LOG_DBG("adding ipv6 addr ("); + LOG_DBG_6ADDR(&ipaddr); + LOG_DBG_("[i=%u])\n", i); + + /* add a binding of the IPv6 address and the MAC address */ + nbr = uip_ds6_nbr_add(&ipaddr, &lladdr, is_router, state, reason, NULL); + if(i < UIP_DS6_NBR_MAX_6ADDRS_PER_NBR) { + UNIT_TEST_ASSERT(nbr != NULL); + UNIT_TEST_ASSERT(memcmp(&nbr->ipaddr, &ipaddr, sizeof(ipaddr)) == 0); + UNIT_TEST_ASSERT(nbr->state == state); + UNIT_TEST_ASSERT(uip_ds6_nbr_num() == (i + 1)); + /* + * for some reason, nbr->isrouter is not set if both UIP_ND6_SEND_RA and + * !UIP_CONF_ROUTER is 0 (see uip-ds6-nbr.c) + */ + // UNIT_TEST_ASSERT(nbr->isrouter == is_router); + ret_lladdr = uip_ds6_nbr_lladdr_from_ipaddr((const uip_ipaddr_t *)&ipaddr); + UNIT_TEST_ASSERT(ret_lladdr != NULL); + UNIT_TEST_ASSERT(memcmp(ret_lladdr, &lladdr, sizeof(lladdr)) == 0); + + } else { + /* i == UIP_DS6_NBR_MAX_6ADDRS_PER_NBR; the address shouldn't be added */ + UNIT_TEST_ASSERT(nbr == NULL); + } + } + + UNIT_TEST_END(); +} + +UNIT_TEST_REGISTER(remove_v6addrs_of_neighbor, + "remove IPv6 addresses associated with a single neighbor"); +UNIT_TEST(remove_v6addrs_of_neighbor) +{ + uip_ipaddr_t ipaddr; + uip_lladdr_t lladdr; + uip_ds6_nbr_t *nbr, *next_nbr; + + memset(&ipaddr, 0, sizeof(ipaddr)); + memset(&lladdr, 0, sizeof(lladdr)); + + UNIT_TEST_BEGIN(); + + /* make sure the neighbor cache table is empty */ + remove_all_entries_in_neighbor_cache(); + UNIT_TEST_ASSERT(uip_ds6_nbr_head() == NULL); + UNIT_TEST_ASSERT(uip_ds6_nbr_num() == 0); + + /* prepare a link-layer address */ + LOG_DBG("link-layer addr: "); + LOG_DBG_LLADDR((const linkaddr_t *)&lladdr); + LOG_DBG_("\n"); + + /* fill the neighbor entry associated with the link-layer address */ + for(int i = 0; i < UIP_DS6_NBR_MAX_6ADDRS_PER_NBR; i++) { + ipaddr.u8[0] = i; + nbr = uip_ds6_nbr_add(&ipaddr, &lladdr, is_router, state, reason, NULL); + UNIT_TEST_ASSERT(nbr != NULL); + UNIT_TEST_ASSERT(uip_ds6_nbr_num() == (i + 1)); + } + + /* remove IPv6 addresses for the link-layer address one by one */ + for(nbr = uip_ds6_nbr_head(); nbr != NULL; nbr = next_nbr) { + LOG_DBG("removing nbr:%p\n", nbr); + next_nbr = uip_ds6_nbr_next(nbr); + UNIT_TEST_ASSERT(uip_ds6_nbr_rm(nbr) == 1); + } + UNIT_TEST_ASSERT(uip_ds6_nbr_num() == 0); + UNIT_TEST_ASSERT(uip_ds6_nbr_head() == NULL); + + UNIT_TEST_END(); + +} + +UNIT_TEST_REGISTER(fill_neighbor_cache_table, + "fill the neighbor cache table"); +UNIT_TEST(fill_neighbor_cache_table) +{ + /* + * We should be able to add the same number of link-layer addresses as + * NBR_TABLE_MAX_NEIGHBORS. In addition, we should be add the same number of + * IPv6 addresses per link-layer address as + * UIP_DS6_NBR_CONF_MAX_6ADDRS_PER_NBR. + */ + uip_ipaddr_t ipaddr; + uip_lladdr_t lladdr; + uip_ds6_nbr_t *nbr; + + memset(&ipaddr, 0, sizeof(ipaddr)); + memset(&lladdr, 0, sizeof(lladdr)); + + UNIT_TEST_BEGIN(); + + /* make sure the neighbor cache table is empty */ + remove_all_entries_in_neighbor_cache(); + UNIT_TEST_ASSERT(uip_ds6_nbr_head() == NULL); + UNIT_TEST_ASSERT(uip_ds6_nbr_num() == 0); + + for(int i = 0; i <= NBR_TABLE_MAX_NEIGHBORS; i++) { + lladdr.addr[0] = i & 0xFF; + lladdr.addr[1] = i >> 8; + for(int j = 0; j <= UIP_DS6_NBR_MAX_6ADDRS_PER_NBR; j++) { + ipaddr.u8[0] = i & 0xFF; + ipaddr.u8[1] = i >> 8; + ipaddr.u8[2] = j; + LOG_DBG("adding ipv6 addr ("); + LOG_DBG_6ADDR(&ipaddr); + LOG_DBG_(") to link-layer addr ("); + LOG_DBG_LLADDR((const linkaddr_t *)&lladdr); + LOG_DBG_(") [i=%u,j=%u]\n", i, j); + + nbr = uip_ds6_nbr_add(&ipaddr, &lladdr, is_router, state, reason, NULL); + if((i < NBR_TABLE_MAX_NEIGHBORS) && + (j < UIP_DS6_NBR_MAX_6ADDRS_PER_NBR)) { + UNIT_TEST_ASSERT(nbr != NULL); + } else if(i == NBR_TABLE_MAX_NEIGHBORS) { + /* we should not be able to add a link-layer address any more */ + UNIT_TEST_ASSERT(j == 0); + UNIT_TEST_ASSERT(nbr == NULL); + break; + } else if(j == UIP_DS6_NBR_MAX_6ADDRS_PER_NBR) { + /* we should not be able to add an IPv6 address any more */ + UNIT_TEST_ASSERT(i < NBR_TABLE_MAX_NEIGHBORS); + UNIT_TEST_ASSERT(nbr == NULL); + break; + } else { + /* shouldn't come here */ + UNIT_TEST_ASSERT(false); + } + } + } + + UNIT_TEST_END(); +} + +PROCESS_THREAD(node_process, ev, data) +{ + PROCESS_BEGIN(); + + UNIT_TEST_RUN(add_v6addrs_to_neighbor); + UNIT_TEST_RUN(remove_v6addrs_of_neighbor); + UNIT_TEST_RUN(fill_neighbor_cache_table); + + printf("\nTEST SUCCEEDED\n"); + exit(0); /* success: all the test passed */ + + PROCESS_END(); +} diff --git a/tests/Makefile.script-test b/tests/Makefile.script-test index e4dd0da6a..e58acec80 100644 --- a/tests/Makefile.script-test +++ b/tests/Makefile.script-test @@ -5,18 +5,14 @@ CONTIKI=../.. all: clean summary -summary: cooja $(TESTLOGS) +summary: $(TESTLOGS) @cat *.testlog > summary @echo "========== Summary ==========" @cat summary -%.testlog: %.sh cooja +%.testlog: %.sh @echo "========== Running script test $(basename $@).sh ==========" @bash "$(basename $@).sh" "$(CONTIKI)" clean: @rm -f *.*log report summary - -cooja: $(CONTIKI)/tools/cooja/dist/cooja.jar -$(CONTIKI)/tools/cooja/dist/cooja.jar: - (cd $(CONTIKI)/tools/cooja; ant jar) diff --git a/tools/doxygen/Doxyfile b/tools/doxygen/Doxyfile index dab2c18e3..2cd7dba72 100644 --- a/tools/doxygen/Doxyfile +++ b/tools/doxygen/Doxyfile @@ -807,8 +807,8 @@ EXCLUDE_SYMLINKS = NO # Note that the wildcards are matched against the file with absolute path, so to # exclude all test directories for example use the pattern */test/* -EXCLUDE_PATTERNS = */cpu/cc26xx-cc13xx/lib/* \ - */cpu/cc26xx-cc13xx/rf-core/api/* \ +EXCLUDE_PATTERNS = */cpu/cc26x0-cc13x0/lib/* \ + */cpu/cc26x0-cc13x0/rf-core/api/* \ */cpu/simplelink-cc13xx-cc26xx/lib/* \ */cpu/simplelink-cc13xx-cc26xx/rf-settings/* \ */cpu/simplelink-cc13xx-cc26xx/cc13x0-cc26x0/driverlib/* \ diff --git a/tools/zolertia/license-bsl.txt b/tools/zolertia/license-bsl.txt deleted file mode 100644 index e6775e9d7..000000000 --- a/tools/zolertia/license-bsl.txt +++ /dev/null @@ -1,62 +0,0 @@ -Copyright (c) 2001-2003 Chris Liechti - -All Rights Reserved. - -This is the Python license. In short, you can use this product in -commercial and non-commercial applications, modify it, redistribute it. -A notification to the author when you use and/or modify it is welcome. - -TERMS AND CONDITIONS FOR ACCESSING OR OTHERWISE USING THIS SOFTWARE -============================================ - -LICENSE AGREEMENT ------------------ - -1. This LICENSE AGREEMENT is between the copyright holder of this -product, and the Individual or Organization ("Licensee") accessing -and otherwise using this product in source or binary form and its -associated documentation. - -2. Subject to the terms and conditions of this License Agreement, -the copyright holder hereby grants Licensee a nonexclusive, -royalty-free, world-wide license to reproduce, analyze, test, -perform and/or display publicly, prepare derivative works, distribute, -and otherwise use this product alone or in any derivative version, -provided, however, that copyright holders License Agreement and -copyright holders notice of copyright are retained in this product -alone or in any derivative version prepared by Licensee. - -3. In the event Licensee prepares a derivative work that is based on -or incorporates this product or any part thereof, and wants to make -the derivative work available to others as provided herein, then -Licensee hereby agrees to include in any such work a brief summary of -the changes made to this product. - -4. The copyright holder is making this product available to Licensee -on an "AS IS" basis. THE COPYRIGHT HOLDER MAKES NO REPRESENTATIONS -OR WARRANTIES, EXPRESS OR IMPLIED. BY WAY OF EXAMPLE, BUT NOT -LIMITATION, THE COPYRIGHT HOLDER MAKES NO AND DISCLAIMS ANY -REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS FOR -ANY PARTICULAR PURPOSE OR THAT THE USE OF THIS PRODUCT WILL -NOT INFRINGE ANY THIRD PARTY RIGHTS. - -5. THE COPYRIGHT HOLDER SHALL NOT BE LIABLE TO LICENSEE OR ANY -OTHER USERS OF THIS PRODUCT FOR ANY INCIDENTAL, SPECIAL, OR -CONSEQUENTIAL DAMAGES OR LOSS AS A RESULT OF MODIFYING, -DISTRIBUTING, OR OTHERWISE USING THIS PRODUCT, OR ANY -DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY -THEREOF. - -6. This License Agreement will automatically terminate upon a -material breach of its terms and conditions. - -7. Nothing in this License Agreement shall be deemed to create any -relationship of agency, partnership, or joint venture between the -copyright holder and Licensee. This License Agreement does not grant -permission to use trademarks or trade names from the copyright holder -in a trademark sense to endorse or promote products or services of -Licensee, or any third party. - -8. By copying, installing or otherwise using this product, Licensee -agrees to be bound by the terms and conditions of this License -Agreement. diff --git a/tools/zolertia/motelist-zolertia b/tools/zolertia/motelist-zolertia deleted file mode 100755 index e5f7da99e..000000000 --- a/tools/zolertia/motelist-zolertia +++ /dev/null @@ -1,295 +0,0 @@ -#!/usr/bin/perl -w -use strict; -# $Id: motelist-z1,v 1.1 2010/08/24 15:48:20 joxe Exp $ -# @author Cory Sharp -# @author Joe Polastre - -my $help = <<'EOF'; -usage: motelist [options] - - $Revision: 1.1 $ - -options: - -h display this help - -c compact format, not pretty but easier for parsing - -f specify the usb-serial file (for smote.cs) - -k kernel version: 2.4, 2.6, auto (default) - -m method to scan usb: procfs, sysfs, auto (default) - -dev_prefix force the device prefix for the serial device - -usb display extra usb information - -b specify which Zolertia board to list (z1, remote, etc) -EOF - -my %Opt = ( - compact => 0, - usb => 0, - board => "", - method => "auto", - kernel => "auto", - dev_prefix => [ "/dev/usb/tts/", "/dev/ttyUSB", "/dev/tts/USB" ], - usbserial => "sudo cat /proc/tty/driver/usbserial |", -); - -while (@ARGV) { - last unless $ARGV[0] =~ /^-/; - my $opt = shift @ARGV; - if( $opt eq "-h" ) { print "$help\n"; exit 0; } - elsif( $opt eq "-c" ) { $Opt{compact} = 1; } - elsif( $opt eq "-f" ) { $Opt{usbserial} = shift @ARGV; } - elsif( $opt eq "-k" ) { $Opt{kernel} = shift @ARGV; } - elsif( $opt eq "-m" ) { $Opt{method} = shift @ARGV; } - elsif( $opt eq "-dev_prefix" ) { $Opt{dev_prefix} = shift @ARGV; } - elsif( $opt eq "-usb" ) { $Opt{usb} = 1; } - elsif( $opt eq "-b" ) { $Opt{board} = shift @ARGV; } - else { print STDERR "$help\nerror, unknown command line option $opt\n"; exit 1; } -} - -if( $Opt{kernel} eq "auto" ) { - $Opt{kernel} = "unknown"; - $Opt{kernel} = $1 if snarf("/proc/version") =~ /\bLinux version (\d+\.\d+)/; -} - -if( $Opt{method} eq "auto" ) { - $Opt{method} = ($Opt{kernel} eq "2.4") ? "procfs" : "sysfs"; -} - -if( $Opt{board} eq "z1" ) { - $Opt{board} = "Zolertia Z1"; -} elsif( $Opt{board} eq "remote" ) { - $Opt{board} = "Zolertia RE-Mote platform"; -} elsif( $Opt{board} eq "firefly" ) { - $Opt{board} = "Zolertia Firefly platform"; -} elsif( $Opt{board} eq "orion" ) { - $Opt{board} = "Zolertia Orion Ethernet router"; -} - -my @devs = $Opt{method} eq "procfs" ? scan_procfs() : scan_sysfs(); -print_motelist( sort { cmp_usbdev($a,$b) } @devs ); - - -# -# SysFS -# -sub scan_sysfs { - - my $tmp = '($_->{UsbVendor}||"") eq "10c4" && ($_->{UsbProduct}||"") eq "ea60"'; - - if($Opt{board}) { - $tmp = '($_->{ProductString}||"") eq $Opt{board} && ' . $tmp - } - - # Scan /sys/bus/usb/drivers/usb for CP210x devices - my @cpdevs = - grep { eval "$tmp" } - map { { - SysPath => $_, - UsbVendor => snarf("$_/idVendor",1), - UsbProduct => snarf("$_/idProduct",1), - ProductString => snarf("$_/product",1), - } } - glob("/sys/bus/usb/drivers/usb/*"); - - # Gather information about each CP210x device - for my $f (@cpdevs) { - my $syspath = $f->{SysPath}; - $f->{InfoSerial} = snarf("$syspath/serial",1); - $f->{InfoManufacturer} = snarf("$syspath/manufacturer",1); - $f->{InfoProduct} = snarf("$syspath/product",1); - $f->{UsbDevNum} = snarf("$syspath/devnum",1); - - my $devstr = readlink($syspath); - if( $devstr =~ m{([^/]+)/usb(\d+)/.*-([^/]+)$} ) { - $f->{UsbPath} = "usb-$1-$3"; - $f->{UsbBusNum} = $2; - } - ($f->{SysDev} = $syspath) =~ s{^.*/}{}; - - my $port = "$syspath/$f->{SysDev}:1.0"; - ($f->{DriverName} = readlink("$port/driver")) =~ s{^.*/}{} if -l "$port/driver"; - ($f->{SerialDevName} = (glob("$port/tty*"),undef)[0]) =~ s{^.*/}{}; - $f->{SerialDevNum} = $1 if $f->{SerialDevName} =~ /(\d+)/; - $f->{SerialDevName} = getSerialDevName( $f->{SerialDevNum} ) || " (none)"; - } - return @cpdevs; -} - - -# -# Scan Procfs -# -sub scan_procfs { - - my $text_devs = snarf("< /proc/bus/usb/devices"); - my $text_serial = snarf($Opt{usbserial}); - - my @usbdevs = map { {parse_usb_devices_text($_)} } - grep { !/^\s*$/ } split /\n+(?=T:)/, $text_devs; - my %usbtree = build_usb_tree( @usbdevs ); - my %usbserialtree = build_usbserial_tree( $text_serial ); - for my $tts ( values %usbserialtree ) { - $usbtree{usbkey($tts->{path})}{usbserial} = $tts if defined $tts->{path}; - } - - my @cpdevs = map { { - UsbVendor => $_->{Vendor}, - UsbProduct => $_->{ProdID}, - InfoManufacturer => $_->{Manufacturer}, - InfoProduct => $_->{Product}, - InfoSerial => $_->{SerialNumber}, - UsbBusNum => $_->{nbus}, - UsbDevNum => $_->{ndev}, - UsbPath => (($Opt{kernel} eq "2.4") ? $_->{usbserial}{path} : $_->{usbpath}), - DriverName => $_->{driver}, - SerialDevNum => $_->{usbserial}{tts}, - SerialDevName => getSerialDevName($_->{usbserial}{tts}) || " (none)", - } } - grep { ($_->{Vendor}||"") eq "0403" && ($_->{ProdID}||"") eq "6001" } - values %usbtree; - - return @cpdevs; -} - -sub build_usb_tree { - my @devs = @_; - my %tree = (); - for my $dev (sort { $a->{Lev} <=> $b->{Lev} } @devs) { - my ($bus,$lev,$prnt) = ( $dev->{Bus}+0, $dev->{Lev}+0, $dev->{Prnt}+0 ); - my $devnum = $dev->{"Dev#"}+0; - $dev->{nbus} = $bus; - $dev->{ndev} = $devnum; - $tree{"bus$bus"} = {} unless exists $tree{"bus$bus"}; - $tree{"bus$bus"}{"dev$devnum"} = $dev; - if( $lev == 0 ) { - $dev->{usbpath} = "usb-$dev->{SerialNumber}"; - } else { - my $sep = ($lev==1) ? "-" : "."; - $dev->{parent} = $tree{"bus$bus"}{"dev$prnt"}; - $dev->{usbpath} = $dev->{parent}{usbpath} . $sep . ($dev->{Port}+1); - } - $tree{usbkey($dev->{usbpath})} = $dev; - } - return %tree; -} - -sub parse_usb_devices_text { - my $text = shift; - $text =~ s/^\S+\s*//gm; - return ($text =~ m/([^\s=]+)=\s*(.*?\S)\s*(?=[^\s=]+=|$)/mg); -} - -sub build_usbserial_tree { - my $text = shift; - my %tree = (); - while( $text =~ /^([^:]+):(.*)/mg ) { - my ($tts,$params) = ($1,$2); - $tree{$tts} = { tts => $tts }; - while ($params =~ m/\s+([^:]+):(?:"([^"]*)"|(\S+))/g) { - $tree{$tts}{$1} = $2||$3; - } - } - return %tree; -} - -sub usbkey { - if( $Opt{kernel} eq "2.4" ) { - (my $key = $_[0]) =~ s/^.*-//; - return $key; - } - return $_[0]; -} - - -# -# getSerialDevName -# -# For each device, force to use dev_prefix if it's not an array. Otherwise, -# assume it's a list of candidate prefixes. Check them and commit to the -# first one that actually exists. -# -sub getSerialDevName { - my $devnum = shift; - my $devname = undef; - if( defined $devnum ) { - if( ref($Opt{dev_prefix}) eq "ARRAY" ) { - $devname = $devnum; - for my $prefix (@{$Opt{dev_prefix}}) { - my $file = $prefix . $devnum; - if( -e $file ) { $devname = $file; last; } - } - } else { - $devname = $Opt{dev_prefix} . $devnum; - } - } - return $devname; -} - - -# -# Print motelist -# -sub print_motelist { - my @devs = @_; - - # If none were found, quit - if( @devs == 0 ) { - print "No devices found.\n"; - return; - } - - # Print a header - if( !$Opt{compact} ) { - if( $Opt{usb} ) { - print << "EOF" unless $Opt{compact}; ---- --- ------------------------ -------------- ---------------- ------------------------------------- -Bus Dev USB Path Reference Device Description ---- --- ------------------------ -------------- ---------------- ------------------------------------- -EOF - } else { - print << "EOF" unless $Opt{compact}; --------------- ---------------- --------------------------------------------- -Reference Device Description --------------- ---------------- --------------------------------------------- -EOF - } - } - - # Print the usb information - for my $dev (sort { cmp_usbdev($a,$b) } @devs) { - my $desc = join( " ", $dev->{InfoManufacturer}||"", $dev->{InfoProduct}||"" ) || " (none)"; - my @output = ( $dev->{InfoSerial}||" (none)", $dev->{SerialDevName}, $desc ); - @output = ( $dev->{UsbBusNum}, $dev->{UsbDevNum}, $dev->{UsbPath}, @output ) if $Opt{usb}; - if( $Opt{compact} ) { - print join(",",@output) . "\n"; - } else { - printf( ($Opt{usb}?"%3d %3d %-24s ":"")."%-14s %-16s %s\n", @output ); - } - } -} - - -# -# Cmp Usbdev's -# -sub cmp_usbdev { - my ($a,$b) = @_; - if( defined $a->{SerialDevNum} ) { - if( defined $b->{SerialDevNum} ) { - return $a->{SerialDevNum} <=> $b->{SerialDevNum}; - } - return -1; - } - return 1 if defined $b->{SerialDevNum}; - return ($a->{InfoSerial}||"") cmp ($b->{InfoSerial}||""); -} - -# -# Read a file in -# -sub snarf { - open my $fh, $_[0] or return undef; - my $text = do{local $/;<$fh>}; - close $fh; - $text =~ s/\s+$// if $_[1]; - return $text; -} - diff --git a/tools/zolertia/motelist-zolertia-macos b/tools/zolertia/motelist-zolertia-macos deleted file mode 100755 index 526b4887e..000000000 --- a/tools/zolertia/motelist-zolertia-macos +++ /dev/null @@ -1,75 +0,0 @@ -#!/usr/bin/perl -w -use strict; - -my $help = <<'EOF'; -usage: motelist [options] - -options: - -h display this help - -c compact format, not pretty but easier for parsing -EOF - -my %Opt = ( - compact => 0, - dev_prefix => [ "/dev/tty.SLAB" ], -); - -while (@ARGV) { - last unless $ARGV[0] =~ /^-/; - my $opt = shift @ARGV; - if( $opt eq "-h" ) { print "$help\n"; exit 0; } - elsif( $opt eq "-c" ) { $Opt{compact} = 1; } - else { print STDERR "$help\nerror, unknown command line option $opt\n"; exit 1; } -} - -print_motelist( scan_dev() ); - -# -# Scan /dev for tty.SLAB* -# -sub scan_dev { - my @devs; - foreach (`ls /dev/tty.SLAB* 2>&1`) { - my($dev, $serial) = /(\/dev\/tty.SLAB(\S+))/; - if ($serial ne "*:") { - my $d; - $d->{"InfoSerial"} = $serial; - $d->{"SerialDevName"} = $dev; - push(@devs, $d); - } - } - return @devs; -} - - -# -# Print motelist -# -sub print_motelist { - my @devs = @_; - - # If none were found, quit - if( @devs == 0 ) { - #print "No devices found.\n"; - return; - } - - # Print a header - if( !$Opt{compact} ) { - print << "EOF" unless $Opt{compact}; -Reference Device Description ----------- --------------------------- --------------------------------------- -EOF - } - - # Print the usb information - for my $dev (@devs) { - my $desc = "(none)"; - my @output = ( $dev->{"InfoSerial"}, $dev->{"SerialDevName"}, $desc ); - if( $Opt{compact} ) { - print join(",",@output) . "\n"; - } else { - printf( "%-10s %-27s %s\n", @output ); - } - } -}