Skip to main content
FW version: Stable

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] [-f<string>] [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].

Options

  • -l - list directory in long format (similar to UNIX ls -l)
  • -r - will go through the directory recursively.
  • -f<string> - only list state variables containing <string> in their name.

Return value

Returns the count of printed items or -1 if given argument (directory) not found.

Examples

commandoutput
lslists items in active directory in standard format
ls -l misclists items in subdirectory misc in long format
ls -ffoolists all items containing foo in their name in active directory
ls -lrfbar dirgoes through directory dir recursively and lists all items containing bar in their names in long format

vr [-r] [-f<string>] [path1] [path2] ... [pathN]

Tool for printing dynamic variables. When run without any arguments prints all dynamic variables in directory vars/.

  • -r - will go through the directory recursively.
  • -f<string> - will only list variables that contain <string> in their names.
  • [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 from vars or a relative path from the active directory. You can say it has a default value vars, 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] [-f<string>] [-d] [path1] [path2] ... [pathN]

Tool for printing parameters. When run without any arguments prints all parameters in the current directory.

  • -r - will go through the directory recursively.
  • -f<string> - will only list variables that contain <string> in their names.
  • -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

retvalmeaning
-2given argument is not a param
-1given argument not found
any positive valuenumber 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 -fmode # 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] [-f<string>] [-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.

  • -r - will go through the directory recursively.
  • -f<string> - only list state variables containing <string> in their name.
  • -p<period> - prints the state variable(s) every <period> miliseconds. <period> has to be a positive number. The printing can be stopped with Ctrl + c or issuing command st.
  • [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 -rfgpio # will list current values of all state variables with gpio in their name

pm [-r] [-f<string>] [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.

Options

  • -r - will go through the directory recursively.
  • -f<string> - only list state variables containing <string> in their name.

Return value

Returns the number of printed permanent variables.

Examples

AM-felix#>pm                 # lists all perm. variables in /permanents
AM-felix#>pm -rfmax # 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