...
Your application can augment this list by registering additional commands. The mote has capacity for a total of 32 CLI commands. The list of built-in commands above uses 10 of those 32 available, meaning you can add up to 22 commands can be added to the built in additional commands. A handler function needs to be defined for each command; it will be called when the user enters the corresponding command. The
Include Page | ||||
---|---|---|---|---|
|
...
Note |
---|
Only the command that are enabled by the current access level are listed in the output of the "help" command. |
active access level | what commands are enabled? |
---|---|
DN_CLI_ACCESS_LOGIN (default) | Only commands of access level DN_CLI_ACCESS_LOGIN . |
DN_CLI_ACCESS_VIEWER | All commands of access levels DN_CLI_ACCESS_VIEWER and DN_CLI_ACCESS_LOGIN . |
DN_CLI_ACCESS_USER | All commands of access levels DN_CLI_ACCESS_USER , DN_CLI_ACCESS_VIEWER and DN_CLI_ACCESS_LOGIN . |
DN_CLI_ACCESS_DUST | All commands of access levels DN_CLI_ACCESS_DUST , DN_CLI_ACCESS_USER , DN_CLI_ACCESS_VIEWER and DN_CLI_ACCESS_LOGIN . |
The default access level is DN_CLI_ACCESS_LOGIN
. Use dnm_ucli_changeAccessLevel()
to change the active access level.
...
The 03-cli_accesslevel
sample application shows how to use the access level. Internally, it defines the following dummy CLI commands:
CLI command | access level value | access level |
---|---|---|
clogin | 1 | DN_CLI_ACCESS_LOGIN |
cviewer | 2 | DN_CLI_ACCESS_VIEWER |
cuser | 3 | DN_CLI_ACCESS_USER |
cdust | 4 | DN_CLI_ACCESS_DUST |
It also defines a level
command which allows you to switch the current user level.
...