Datasheet
Adding Shell Commands
Mynewt includes a 'Shell' library that allows you to add an extensible command-line style interface to your applications.
You can implement custom commands that users can execute over a simple serial connection, and display formatted
text back to the end users.
Adding shell support
To add shell support to your app, make sure the following pkg.deps are defined in your pkg.yml file:
And in the syscfg.vals section of syscfg.yml add the following:
Adding a custom command handler
To add a new command handler use the following code snippets, placing the different sections at an appropriate place
in your code:
The official Shell documentation can be seen here:
https://mynewt.apache.org/latest/os/modules/shell/shell.html
pkg.deps:
- "@apache-mynewt-core/sys/console/full"
- "@apache-mynewt-core/sys/shell"
- "@apache-mynewt-core/sys/sysinit"
syscfg.vals:
# Enable the shell task.
SHELL_TASK: 1
© Adafruit Industries https://learn.adafruit.com/adafruit-nrf52-pro-feather Page 58 of 87










