Skip to content

Commit bebd43c

Browse files
committed
task-0*: various updates
Fix dead link, broken references and replace shell_commands structure with SHELL_COMMAND macro.
1 parent f327fa3 commit bebd43c

7 files changed

Lines changed: 17 additions & 26 deletions

File tree

task-01/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,9 @@
9393
This command will compile the application, burn the image onto the board and open a
9494
connection to the RIOT shell.
9595

96-
3. Verify the output of `RIOT_BOARD` matches your hardware.
96+
3. Verify the compiler output of matches your hardware, for example:
97+
```
98+
Building application "Task01" for "samr21-xpro" with CPU "samd21".
99+
```
97100

98101
[next task](../task-02)

task-02/README.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,15 @@ this shell command plus one for the name of the command.
1313
Your function must return `0` if it runs successfully and or anything else if
1414
an error occurs.
1515
16-
Shell commands need to be added manually to the shell on initialization
16+
Shell commands need to be added manually to the shell on initialization,
17+
usually this is done with the macro command `SHELL_COMMAND()`.
1718
```c
1819
#include "shell.h"
1920
20-
static const shell_command_t shell_commands[] = {
21-
{ "command name", "command description", cmd_handler },
22-
{ NULL, NULL, NULL }
23-
};
21+
SHELL_COMMAND("command name", "command description", cmd_handler);
2422
2523
/* ... */
26-
shell_run(commands, line_buf, SHELL_DEFAULT_BUFSIZE)
24+
shell_run(NULL, line_buf, SHELL_DEFAULT_BUFSIZE)
2725
/* ... */
2826
```
2927

task-02/main.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,12 @@ int echo(int argc, char **argv)
1212
return 0;
1313
}
1414

15-
static const shell_command_t commands[] = {
16-
{ NULL, NULL, NULL }
17-
};
18-
1915
int main(void)
2016
{
2117
puts("This is Task-02");
2218

2319
char line_buf[SHELL_DEFAULT_BUFSIZE];
24-
shell_run(commands, line_buf, SHELL_DEFAULT_BUFSIZE);
20+
shell_run(NULL, line_buf, SHELL_DEFAULT_BUFSIZE);
2521

2622
return 0;
2723
}

task-05/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ options or states.
1313
Note inclusion of `netdev` modules in the [Makefile](Makefile)
1414

1515
```Makefile
16-
USEMODULE += gnrc_netdev_default
16+
USEMODULE += netdev_default
1717
USEMODULE += auto_init_gnrc_netif
1818
```
1919

task-06/main.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,16 @@ static msg_t _main_msg_queue[MAIN_QUEUE_SIZE];
1010
extern int udp_send(int argc, char **argv);
1111
extern int udp_server(int argc, char **argv);
1212

13-
static const shell_command_t shell_commands[] = {
14-
{ "udp", "send udp packets", udp_send },
15-
{ "udps", "start udp server", udp_server },
16-
{ NULL, NULL, NULL }
17-
};
13+
SHELL_COMMAND("udp", "send udp packets", udp_send);
14+
SHELL_COMMAND("udps", "start udp server", udp_server);
1815

1916
int main(void)
2017
{
2118
msg_init_queue(_main_msg_queue, MAIN_QUEUE_SIZE);
2219
puts("This is Task-06");
2320

2421
char line_buf[SHELL_DEFAULT_BUFSIZE];
25-
shell_run(shell_commands, line_buf, SHELL_DEFAULT_BUFSIZE);
22+
shell_run(NULL, line_buf, SHELL_DEFAULT_BUFSIZE);
2623

2724
return 0;
2825
}

task-08/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ RIOT provides three shell to interact with the CCN-Lite stack:
4747

4848
## Task 8.2: Modify the default shell commands (advanced task)
4949

50-
* Take a look at the default shell commands in `sys/shell/commands/sc_ccnl.c`
50+
* Take a look at the default shell commands in `sys/shell/cmds/ccn-lite-utils.c`
5151
* Create a new command to send an interest with a shorter timeout
52-
(see [https://doc.riot-os.org/group__pkg__ccnlite.html](https://doc.riot-os.org/group__pkg__ccnlite.html)
52+
(see https://github.com/cn-uofbasel/ccn-lite/tree/master/doc )
5353
* Use `ccnl_set_local_producer()` to create content on the fly
5454

5555
[next task](../task-09)

task-09/main.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,7 @@ static msg_t _main_msg_queue[MAIN_QUEUE_SIZE];
3636

3737
extern int udp_cmd(int argc, char **argv);
3838

39-
static const shell_command_t shell_commands[] = {
40-
{ "udp", "send data over UDP and listen on UDP ports", udp_cmd },
41-
{ NULL, NULL, NULL }
42-
};
39+
SHELL_COMMAND("udp", "send data over UDP and listen on UDP ports", udp_cmd);
4340

4441
#ifdef MODULE_GNRC_SIXLOWPAN
4542
static char _stack[THREAD_STACKSIZE_MAIN];
@@ -110,7 +107,7 @@ int main(void)
110107
/* start shell */
111108
puts("All up, running the shell now");
112109
char line_buf[SHELL_DEFAULT_BUFSIZE];
113-
shell_run(shell_commands, line_buf, SHELL_DEFAULT_BUFSIZE);
110+
shell_run(NULL, line_buf, SHELL_DEFAULT_BUFSIZE);
114111

115112
/* should be never reached */
116113
return 0;

0 commit comments

Comments
 (0)