User's Manual

All commands could be divided into five groups: Set/Get commands, Action
commands, characteristic access commands, private service configuration
commands and Microchip MLDP commands.
3.2.1 Set/Get commands
This group of commands is used to configure the functionality of RN4020 module.
The set command starts with letter ‘S’ and follow by one or two letters as the
command identifier. The set command parameter is mandatory and it is separated
from the command by comma. The format of set command could be seen in Figure 1.
Figure 1: Set Command Format
S
Command Identifier
,
Input Parameter
It is highly desirable to perform a reboot after the set command so the new settings
could be effective afterwards. All configurations from Set command will be stored in
the NVM of RN4020 module and restored after powering cycle or reset. All set
command has corresponding get command to output the configurations to the
UART. Get command has the same command identifier as set command but no
parameters.
3.2.1.1 S-,<string>
This command sets the serialized friendly name of the device, where <string> is up
to 15 alphanumeric characters. This command automatically appends the last 2
bytes of the Bluetooth MAC address to the name, which is useful for generating a
custom name with unique numbering.
Default: N/A
Example: S-,MyDevice // Set device name to “MyDevice-ABCD”
3.2.1.2 S@,<0-2>,<hex16>
This command set the analogue port output voltage. There are two parameters for
this command. The first parameter could be 0, 1 or 2, specifying the analogue port
number. The second parameter is the output voltage in mV. Notice the range of
output voltage is between 0 – 1.3V. When outputting analogue signal, RN4020 could
not be run under deep sleep mode. Instead, the firmware will automatically adjust
the operation mode to shallow sleep. Once analogue output is turned off by issuing
command “S@,<0-2>,0000”, the firmware will again automatically adjust the
operation mode back to deep sleep when available.
Example: S@,1,03E8 // Set AIO1 output voltage to be 1000mV