Listing commands
help [command]
Prints help text for the given [command]
. If no [command]
argument is given, it writes down help texts for all available commands in the active directory plus all help texts for commands in directory /commands
. Each help text is ended by a new line.
Keep in mind that help texts are usually short because of the memory restrictions in the controller, if you want to learn more about a command preferably use this wiki page.
Return value
When called without an argument, returns the count of all printed out commands. If called with an argument (name of the command), will return 0
if the command is found and printed out and 1
if no command with the given name is found.
Example
AM-felix#>help version
-> version: print meta/version
AM-felix#>
ls [-l] [-r] [directory]
Mimics the usual UNIX ls
command. Lists items in [directory]
. If no [directory]
argument is given, lists active directory. Beware that in our filesystem, we don't use directories .
and ..
as you'd expect in a UNIX system, so you can't include them in [directory]
. The wildcard character '*' can be used for name pattern matching.
Options
-l
- list directory in long format (similar to UNIXls -l
)-r
- will go through the directory recursively.
Return value
Returns the count of printed items or -1
if given argument (directory) not found.
Examples
command | output |
---|---|
ls | lists items in active directory in standard format |
ls -l misc | lists items in subdirectory misc in long format |
ls *foo* | lists all items containing foo in their name in active directory |
ls -lr *bar dir | goes through directory dir recursively and lists all items ending with bar in their names in long format |
vr [-r] [path1] [path2] ... [pathN]
Tool for printing dynamic variables. When run without any arguments prints all dynamic variables in directory vars/
. The wildcard character '*' can be used for name pattern matching.
-r
- will go through the directory recursively.[path1] - [pathN]
- Can be a path to a directory, in that case, lists all dynamic variables in that directory, or can be a path to a dynamic variable, then lists just the one variable. Can be either path fromvars
or a relative path from the active directory. You can say it has a default valuevars
, meaning it will list directory/vars
if no argument[path]
is given.
Return value
Returns number of printed values. Return -1
if no variable with the given name was found and -2
if there exists an entry with the given name but it is not a dynamic variable.
pr [-r] [-d] [path1] [path2] ... [pathN]
Tool for printing parameters. When run without any arguments prints all parameters in the current directory. The wildcard character '*' can be used for name pattern matching.
-r
- will go through the directory recursively.-d
- won't print out parameters that have default values.[path1] - [pathN]
- Can be a path to a directory, in that case, lists all parameters in that directory, or can be a path to a parameter, in that case, lists just the one parameter. Can be an absolute path (starting with/
) or a relative path (without/
at the beginning). If no[path]
is given, lists all parameters from the current directory.
Return value
retval | meaning |
---|---|
-2 | given argument is not a param |
-1 | given argument not found |
any positive value | number of printed parameters |
Example
AM-felix#>pr # list all parameters
List of available params:
-> sampling_time uint8 : 100 (100), Interval for sending msg from driver API
-> mode_forward uint8 : 2 (2), Driver mode when cmd is positive
-> mode_reverse uint8 : 8 (8), Driver mode when cmd is negative
Total 3 entries
AM-felix#>pr *mode* # list only parameters containing "mode" in their name
List of available params:
-> mode_forward uint8 : 2 (2), Driver mode when cmd is positive
-> mode_reverse uint8 : 8 (8), Driver mode when cmd is negative
Total 2 entries
AM-felix#>pr -d # list only non-default parameters
List of available params:
Total 0 entries # all my parameters are default
st [-r] [-p<period>] [path/state variable] ...
Prints the given state variable or all state variables in a given directory. If no argument is given, the command prints all state variables in the active directory. The command can take multiple arguments. The wildcard character '*' can be used for name pattern matching.
-r
- will go through the directory recursively.-p<period>
- prints the state variable(s) every<period>
miliseconds.<period>
has to be a positive number. The printing can be stopped withCtrl
+c
or issuing commandst
.[path/state variable]
- If specified, will print out that state variable, or if the path leads to a directory, all state variables in that directory. There can be more than one argument of both directories and variables. If no argument is given will use the active directory as default.
Return value
Returns number of printed values. Return -1
if no state variable with the given name was found and -2
if there exists an entry with the given name but it is not a state variable.
Examples
AM-felix#>st driver/energy -p500 # will print twice a second state variable driver/energy
AM-felix#>st -r gpio* # will list current values of all state variables whose name starts with 'gpio'
pm [-r] [path/permanent variable]
Tool for printing permanent variables and their values. If an argument is specified, will print out that permanent variable, or if a path to a directory is given, all permanent variables in that directory will be printed. There can be more than one argument of both directories and variables. If no argument is given pm
will use the directory /permaments
as default. The wildcard character '*' can be used for name pattern matching.
Options
-r
- will go through the directory recursively.
Return value
Returns the number of printed permanent variables.
Examples
AM-felix#>pm # lists all perm. variables in /permanents
AM-felix#>pm -r *max* # lists all perm. variables containing 'max' in their name recursively
AM-felix#>pm time ttl permanents/single_run
AM-felix#> # lists variable time, ttl, and all variables in permanents/single_run