
The textual console can receive the user input and call the appropriate handler function. The Bluetooth
®
Low
Energy and USB interfaces are used at the same time for the input. The responses are outputs on both
interfaces, regardless of the one that received the command.
The handler functions are defined in the
Astra_sysmng.c
as follows:
/**
* @brief Command handler descriptor
*/
typedef struct s_cmd_struct {
char cCmdString[20]; //!< Command string
char cCmdHelp[50]; //!< Command help string
pCmdHandlerFunc_t pCmdHandlerFunc; //!< Command function pointer
uint8_t bShowInHelp; //!< To show the function with '?' command
uint8_t bPrintConfig; //!< To disable message printing after
command execution
} xCmdStruct_t;
Each command is identified by:
•
a command string that identifies the string sent by the user to trigger the command; it can be followed by
parameters
•
a command help string that gives a brief description of the command when the command list is shown
(see
?
command)
•
the command function that is called to process the command
•
the
bShowInHelp
flag to hide the function when the command list is shown (see
?
command)
•
the
bPrintConfig
flag to suspend the printing (or reduce verbosity) after a command execution; this
ensures that the command response is not overtaken by other traces
As a general rule, the command behavior is identified by the first character.
?
is the starting character for the
get
commands.
!
is the starting character for the
set
commands.
The following table lists the implemented commands with some additional information with respect to the brief
description available with the
?
command.
Table 2.
CLI command list
ASCII command
Short help
Set/Get
Description
?
Help
G
It shows this command list
?fwversion
View firmware information
G
It gets the firmware version
?hwversion
View hardware information
G
It gets the hardware version
?blemacaddr
View Bluetooth
®
Low Energy
MAC address
G
It gets the Bluetooth
®
Low Energy
MAC address
?loraparams
View LoRa parameters
G
It gets the LoRa connection
parameters
?verbosity
View verbosity level
G
It gets the log messages verbosity
level
!verbosity
Set verbosity level
S
It sets the log messages verbosity
level. Usage:
!verbosity-X
where X is the verbosity level. The
allowed values are:
1.
LEVEL_TERMINAL
2.
LEVEL_ERROR
3.
LEVEL_CRITICAL
4.
LEVEL_VERBOSE
5.
LEVEL_INFO
!sysreset
System reset
S
It forces a system reset
!sysdfu
System DFU mode
S
It forces a system reboot in USB
DFU mode
UM3019
CLI, command line interface, and debug console on Bluetooth® Low Energy and USB
UM3019
-
Rev 1
page 30/43