diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 71a52e2..9920f3d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -36,8 +36,8 @@ jobs: - run: make -C task-06 -j all - name: Run make -C task-07 -j all run: | - make -C RIOT/examples/gnrc_minimal -j all - make -C RIOT/examples/gnrc_networking -j all + make -C RIOT/examples/networking/gnrc/minimal -j all + make -C RIOT/examples/networking/gnrc/networking -j all - run: make -C task-08 -j all - run: make -C task-09 -j all diff --git a/RIOT b/RIOT index 648e293..a897b04 160000 --- a/RIOT +++ b/RIOT @@ -1 +1 @@ -Subproject commit 648e293b31b50a79ba395cd88fbc430a21c1eab6 +Subproject commit a897b0498f635654f091bf9f33e9696aa773e886 diff --git a/task-01/Makefile b/task-01/Makefile index e27cfc4..85d062f 100644 --- a/task-01/Makefile +++ b/task-01/Makefile @@ -10,14 +10,14 @@ RIOTBASE ?= $(CURDIR)/../RIOT # Comment this out to disable code in RIOT that does safety checking # which is not needed in a production environment but helps in the # development process: -CFLAGS += -DDEVELHELP +DEVELHELP = 1 # Change this to 0 show compiler invocation lines by default: QUIET ?= 1 # Modules to include: USEMODULE += shell -USEMODULE += shell_commands +USEMODULE += shell_cmds_default USEMODULE += ps include $(RIOTBASE)/Makefile.include diff --git a/task-01/README.md b/task-01/README.md index 4a48d21..79a7723 100644 --- a/task-01/README.md +++ b/task-01/README.md @@ -93,6 +93,9 @@ This command will compile the application, burn the image onto the board and open a connection to the RIOT shell. -3. Verify the output of `RIOT_BOARD` matches your hardware. +3. Verify the compiler output of matches your hardware, for example: + ``` + Building application "Task01" for "samr21-xpro" with CPU "samd21". + ``` [next task](../task-02) diff --git a/task-02/Makefile b/task-02/Makefile index 4aecb56..8f37c7e 100644 --- a/task-02/Makefile +++ b/task-02/Makefile @@ -10,14 +10,14 @@ RIOTBASE ?= $(CURDIR)/../RIOT # Comment this out to disable code in RIOT that does safety checking # which is not needed in a production environment but helps in the # development process: -CFLAGS += -DDEVELHELP +DEVELHELP = 1 # Change this to 0 show compiler invocation lines by default: QUIET ?= 1 # Modules to include: USEMODULE += shell -USEMODULE += shell_commands +USEMODULE += shell_cmds_default USEMODULE += ps include $(RIOTBASE)/Makefile.include diff --git a/task-02/README.md b/task-02/README.md index e83c200..f27f4e0 100644 --- a/task-02/README.md +++ b/task-02/README.md @@ -13,17 +13,17 @@ this shell command plus one for the name of the command. Your function must return `0` if it runs successfully and or anything else if an error occurs. -Shell commands need to be added manually to the shell on initialization +Shell commands need to be added manually to the shell on initialization, +usually this is done with the macro command `SHELL_COMMAND()`. +Please note that the command name is *not* written in quotes and can not have +any whitespaces! ```c #include "shell.h" -static const shell_command_t shell_commands[] = { - { "command name", "command description", cmd_handler }, - { NULL, NULL, NULL } -}; +SHELL_COMMAND(command_name, "command description", cmd_handler); /* ... */ - shell_run(commands, line_buf, SHELL_DEFAULT_BUFSIZE) + shell_run(NULL, line_buf, SHELL_DEFAULT_BUFSIZE) /* ... */ ``` diff --git a/task-02/main.c b/task-02/main.c index 804ab37..8d3ce55 100644 --- a/task-02/main.c +++ b/task-02/main.c @@ -12,16 +12,12 @@ int echo(int argc, char **argv) return 0; } -static const shell_command_t commands[] = { - { NULL, NULL, NULL } -}; - int main(void) { puts("This is Task-02"); char line_buf[SHELL_DEFAULT_BUFSIZE]; - shell_run(commands, line_buf, SHELL_DEFAULT_BUFSIZE); + shell_run(NULL, line_buf, SHELL_DEFAULT_BUFSIZE); return 0; } diff --git a/task-03/Makefile b/task-03/Makefile index b822f7e..59a1f34 100644 --- a/task-03/Makefile +++ b/task-03/Makefile @@ -10,14 +10,14 @@ RIOTBASE ?= $(CURDIR)/../RIOT # Comment this out to disable code in RIOT that does safety checking # which is not needed in a production environment but helps in the # development process: -CFLAGS += -DDEVELHELP +DEVELHELP = 1 # Change this to 0 show compiler invocation lines by default: QUIET ?= 1 # Modules to include: USEMODULE += shell -USEMODULE += shell_commands +USEMODULE += shell_cmds_default USEMODULE += ps include $(RIOTBASE)/Makefile.include diff --git a/task-04/Makefile b/task-04/Makefile index 20ec6de..ccc9b5f 100644 --- a/task-04/Makefile +++ b/task-04/Makefile @@ -10,14 +10,14 @@ RIOTBASE ?= $(CURDIR)/../RIOT # Comment this out to disable code in RIOT that does safety checking # which is not needed in a production environment but helps in the # development process: -CFLAGS += -DDEVELHELP +DEVELHELP = 1 # Change this to 0 show compiler invocation lines by default: QUIET ?= 1 # Modules to include: USEMODULE += shell -USEMODULE += shell_commands +USEMODULE += shell_cmds_default USEMODULE += ps USEMODULE += xtimer diff --git a/task-05/Makefile b/task-05/Makefile index 0449ac9..064a2e9 100644 --- a/task-05/Makefile +++ b/task-05/Makefile @@ -10,18 +10,18 @@ RIOTBASE ?= $(CURDIR)/../RIOT # Comment this out to disable code in RIOT that does safety checking # which is not needed in a production environment but helps in the # development process: -CFLAGS += -DDEVELHELP +DEVELHELP = 1 # Change this to 0 show compiler invocation lines by default: QUIET ?= 1 # Modules to include: USEMODULE += shell -USEMODULE += shell_commands +USEMODULE += shell_cmds_default USEMODULE += ps USEMODULE += gnrc_pktdump USEMODULE += gnrc_txtsnd -USEMODULE += gnrc_netdev_default +USEMODULE += netdev_default USEMODULE += auto_init_gnrc_netif include $(RIOTBASE)/Makefile.include diff --git a/task-05/README.md b/task-05/README.md index 9d425ba..a5a1e7c 100644 --- a/task-05/README.md +++ b/task-05/README.md @@ -13,7 +13,7 @@ options or states. Note inclusion of `netdev` modules in the [Makefile](Makefile) ```Makefile -USEMODULE += gnrc_netdev_default +USEMODULE += netdev_default USEMODULE += auto_init_gnrc_netif ``` diff --git a/task-06/Makefile b/task-06/Makefile index 1631f07..73731c4 100644 --- a/task-06/Makefile +++ b/task-06/Makefile @@ -8,21 +8,21 @@ BOARD ?= native RIOTBASE ?= $(CURDIR)/../RIOT # Uncomment this to enable scheduler statistics for ps: -#CFLAGS += -DSCHEDSTATISTICS +#USEMODULE += schedstatistics # Comment this out to disable code in RIOT that does safety checking # which is not needed in a production environment but helps in the # development process: -CFLAGS += -DDEVELHELP +DEVELHELP = 1 # Change this to 0 show compiler invocation lines by default: QUIET ?= 1 # Modules to include: USEMODULE += shell -USEMODULE += shell_commands +USEMODULE += shell_cmds_default USEMODULE += ps -USEMODULE += gnrc_netdev_default +USEMODULE += netdev_default USEMODULE += auto_init_gnrc_netif USEMODULE += gnrc_ipv6_default USEMODULE += gnrc_icmpv6_echo diff --git a/task-06/main.c b/task-06/main.c index 336293e..2815edf 100644 --- a/task-06/main.c +++ b/task-06/main.c @@ -10,11 +10,8 @@ static msg_t _main_msg_queue[MAIN_QUEUE_SIZE]; extern int udp_send(int argc, char **argv); extern int udp_server(int argc, char **argv); -static const shell_command_t shell_commands[] = { - { "udp", "send udp packets", udp_send }, - { "udps", "start udp server", udp_server }, - { NULL, NULL, NULL } -}; +SHELL_COMMAND(udp, "send udp packets", udp_send); +SHELL_COMMAND(udps, "start udp server", udp_server); int main(void) { @@ -22,7 +19,7 @@ int main(void) puts("This is Task-06"); char line_buf[SHELL_DEFAULT_BUFSIZE]; - shell_run(shell_commands, line_buf, SHELL_DEFAULT_BUFSIZE); + shell_run(NULL, line_buf, SHELL_DEFAULT_BUFSIZE); return 0; } diff --git a/task-08/Makefile b/task-08/Makefile index 9981179..93defc4 100644 --- a/task-08/Makefile +++ b/task-08/Makefile @@ -6,13 +6,14 @@ BOARD ?= native # This has to be the absolute path to the RIOT base directory: RIOTBASE ?= $(CURDIR)/../RIOT -BOARD_WHITELIST := fox iotlab-m3 msba2 mulle native pba-d-01-kw2x samr21-xpro +BOARD_WHITELIST := iotlab-m3 msba2 mulle native pba-d-01-kw2x samr21-xpro # This has to be the absolute path to the RIOT base directory: RIOTBASE ?= $(CURDIR)/../.. -CFLAGS += -DDEVELHELP +DEVELHELP = 1 + CFLAGS += -DUSE_LINKLAYER CFLAGS += -DUSE_RONR CFLAGS += -DCCNL_UAPI_H_ @@ -25,10 +26,10 @@ QUIET ?= 1 USEMODULE += ps USEMODULE += shell -USEMODULE += shell_commands +USEMODULE += shell_cmds_default # Include packages that pull up and auto-init the link layer. # NOTE: 6LoWPAN will be included if IEEE802.15.4 devices are present -USEMODULE += gnrc_netdev_default +USEMODULE += netdev_default USEMODULE += auto_init_gnrc_netif USEMODULE += timex USEMODULE += xtimer diff --git a/task-08/README.md b/task-08/README.md index 7dcc81f..1477db1 100644 --- a/task-08/README.md +++ b/task-08/README.md @@ -47,9 +47,9 @@ RIOT provides three shell to interact with the CCN-Lite stack: ## Task 8.2: Modify the default shell commands (advanced task) -* Take a look at the default shell commands in `sys/shell/commands/sc_ccnl.c` +* Take a look at the default shell commands in `sys/shell/cmds/ccn-lite-utils.c` * Create a new command to send an interest with a shorter timeout -(see [https://doc.riot-os.org/group__pkg__ccnlite.html](https://doc.riot-os.org/group__pkg__ccnlite.html) +(see https://github.com/cn-uofbasel/ccn-lite/tree/master/doc ) * Use `ccnl_set_local_producer()` to create content on the fly [next task](../task-09) diff --git a/task-09/Makefile b/task-09/Makefile index 0585684..8bd7652 100644 --- a/task-09/Makefile +++ b/task-09/Makefile @@ -7,14 +7,14 @@ BOARD ?= native # This has to be the absolute path to the RIOT base directory: RIOTBASE ?= $(CURDIR)/../RIOT -BOARD_INSUFFICIENT_MEMORY := airfy-beacon chronos msb-430 msb-430h nrf51dongle \ - nrf6310 nucleo-f103 nucleo-f334 pca10000 pca10005 spark-core \ - stm32f0discovery telosb weio wsn430-v1_3b wsn430-v1_4 \ - yunjia-nrf51822 z1 nucleo-f072 +BOARD_INSUFFICIENT_MEMORY := airfy-beacon msb-430 msb-430h nrf51dongle \ + nucleo-f103rb nucleo-f334r8 spark-core \ + stm32f0discovery telosb \ + yunjia-nrf51822 z1 nucleo-f072rb # Include packages that pull up and auto-init the link layer. # NOTE: 6LoWPAN will be included if IEEE802.15.4 devices are present -USEMODULE += gnrc_netdev_default +USEMODULE += netdev_default USEMODULE += auto_init_gnrc_netif # Specify the mandatory networking modules for IPv6 and UDP USEMODULE += gnrc_ipv6_router_default @@ -28,7 +28,7 @@ USEMODULE += gnrc_pktdump USEMODULE += gnrc_icmpv6_echo # Add also the shell, some shell commands USEMODULE += shell -USEMODULE += shell_commands +USEMODULE += shell_cmds_default USEMODULE += ps USEMODULE += netstats_l2 USEMODULE += netstats_ipv6 @@ -45,7 +45,7 @@ CFLAGS += -DGNRC_RPL_DEFAULT_DIO_INTERVAL_DOUBLINGS=13 # Comment this out to disable code in RIOT that does safety checking # which is not needed in a production environment but helps in the # development process: -CFLAGS += -DDEVELHELP +DEVELHELP = 1 # Comment this out to join RPL DODAGs even if DIOs do not contain # DODAG Configuration Options (see the doc for more info) diff --git a/task-09/main.c b/task-09/main.c index 84bd372..6ee3497 100644 --- a/task-09/main.c +++ b/task-09/main.c @@ -36,10 +36,7 @@ static msg_t _main_msg_queue[MAIN_QUEUE_SIZE]; extern int udp_cmd(int argc, char **argv); -static const shell_command_t shell_commands[] = { - { "udp", "send data over UDP and listen on UDP ports", udp_cmd }, - { NULL, NULL, NULL } -}; +SHELL_COMMAND(udp, "send data over UDP and listen on UDP ports", udp_cmd); #ifdef MODULE_GNRC_SIXLOWPAN static char _stack[THREAD_STACKSIZE_MAIN]; @@ -110,7 +107,7 @@ int main(void) /* start shell */ puts("All up, running the shell now"); char line_buf[SHELL_DEFAULT_BUFSIZE]; - shell_run(shell_commands, line_buf, SHELL_DEFAULT_BUFSIZE); + shell_run(NULL, line_buf, SHELL_DEFAULT_BUFSIZE); /* should be never reached */ return 0;