-
Notifications
You must be signed in to change notification settings - Fork 0
tips
Some Tips for using Modem-E Command Interpreter:
- Input
help
for the usage. - Input
list_cmds
to see all supported commands. - Input
command -h
orcommand --help
to get the usage of a specific command. - Use
find
to search commands. - Commands and arguments are case-insensitive.
- Commands and arguments are separated by whitespace, but can also use
:
or-
or,
instead.
The Interpreter command line interface provides some facilities to help the user to type less and type more quickly (Linux users would feel familiar with below behaviors):
- Auto completion with
Table
key. -
readline
shortcut support. Sadly, it doesn't support all the readline shortcuts, but the basic ones are available. - The last 10 inputted commands are saved as history in the current session, so they can be recalled by
PgUp/PgDown
orCtrl-P/Ctrl-N
.
With find
, the user can filter from the dozens of supported commands to find out the right one. It can support 0 or 1 or more arguments:
- When provide no argument, just
find
, it simply lists all the supported commands - When provide 1 argument, it lists all commands whose name contains such argument
- When provide 2 or more arguments, the commands whose name contains all of those arguments are listed, no matter the sequence of the arguments, which means
find get class
equalsfind class get
.
Per the last tip, below commands are equal:
- set_dev_eui 0E:0F:10:CC:DD:13:14:15
- set_dev_eui 0E 0F 10 CC DD 13 14 15
- set_dev_eui 0E-0F-10-CC-DD-13-14-15
- set_dev_eui 0E,0F,10,CC,DD,13,14,15
- set_dev_eui E F 10 CC DD 13 14 15
- set_dev_eui 0E, 0F, 10, CC, DD, 13, 14, 15
For commands used to set EUI or Keys, we recommend the first style, for other commands, we suggest the second style. But feel free to use whatever style you prefer.
Generally, the numbers in the arguments are treated as 10-based digital, unless you explicitly use 0x
or 0X
. However, for commands used to set EUI or Keys, the numbers are treated as 16-based as above example shows. 8-based numbers are not supported. If in doubt, please use 0x
or 0X
, or check the command usage by -h
.
Per the last 2 tips, it's very flexible to use Interpreter. For example: set_class C
equals to set_class c
.
Sometimes, you can use abbreviation to save a few key strikes. For example, in commands with argument for "enable" or "disable" (such as lbt_set_state
and set_relay_config
):
- these arguments are all valid as "enable":
on
,en
,enable
. - these are all valid as "disable":
off
,dis
,disable
.