Skip to content

Commit eaa1033

Browse files
committed
examples/openthread: Adept example to new shell usage
Add shell to example and update readme.
1 parent 6f791f4 commit eaa1033

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

examples/networking/misc/openthread/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ open source implementation of [Thread](https://threadgroup.org/) on RIOT.
66
The [Command Line Interface](https://github.com/openthread/openthread/blob/master/examples/apps/cli/README.md) of
77
OpenThread was ported. Please check the
88
[full documentation](https://github.com/openthread/openthread/blob/master/src/cli/README.md)
9-
of the CLI for usage information.
9+
of the CLI for usage information. Commands start with prefix 'ot'.
1010

1111
You can either build a FTD or MTD firmware:
1212
- MTD: A Minimal Thread Device does not have router functionality compiled in.
@@ -40,13 +40,13 @@ make BOARD=<target> clean all flash OPENTHREAD_TYPE=mtd
4040
make BOARD=<target> clean all flash OPENTHREAD_TYPE=ftd
4141
```
4242

43-
2. Check the state of the node with `state`. In the beginning, it should be
43+
2. Check the state of the node with `ot state`. In the beginning, it should be
4444
`detached`, but after some seconds it should become `leader`
4545

4646
3. Start another node and check that it becomes `router`. There is only one
4747
leader in a Thread network.
4848

49-
4. Get the mesh IP address of a node with `ipaddr`.
49+
4. Get the mesh IP address of a node with `ot ipaddr`.
5050
```
5151
ipaddr
5252
fdde:ad00:beef::ff:fe00:8000
@@ -59,9 +59,9 @@ ipaddr
5959
ping fdde:ad00:beef:0:946a:c722:a5d9:848
6060
```
6161

62-
6. You can try IEEE802.15.4 scan with `scan` command
62+
6. You can try IEEE802.15.4 scan with `ot scan` command
6363

64-
7. You can also check other commands with `help`
64+
7. You can also check other commands with `ot help`
6565

6666

6767
## OpenThread port on RIOT status

examples/networking/misc/openthread/main.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212

1313
#include <stdio.h>
1414

15+
#include "shell.h"
16+
1517
#include "ot.h"
1618
#include "openthread/thread.h"
1719

@@ -45,5 +47,8 @@ int main(void)
4547
*/
4648
event_post(openthread_get_evq(), &event_panid);
4749

50+
char line_buf[SHELL_DEFAULT_BUFSIZE];
51+
shell_run(NULL, line_buf, SHELL_DEFAULT_BUFSIZE);
52+
4853
return 0;
4954
}

0 commit comments

Comments
 (0)