User's Manual

followed by one or more logic operations or AT commands. Once an event is
triggered, if an event label is defined, then control is passed over to the script
engine. The script engine starts executing the commands that are listed below the
event label until the end of script or encountering another event label.
Table 7. List of Events and Event Labels
Event
Event Label
Power On
@PW_ON
Timer 1 expired
@TMR1
Timer 2 expired
@TMR2
Connected
@CONN
Disconnected
@DISCON
PIO 8 Input Change to Low
@GPIOL
PIO 8 Input Change to High
@GPIOH
3.3.6.2.2 Comments
RN4020 script engine handles the script line by line. Each line could start with
multiple spaces or tabs and end with return or line feed. Even though space is
generally not supported between AT commands and its parameters, same as
command through UART, spaces or tabs are supported in assignment and logic
expressions, as described below.
Comment lines could be added to the script. Comment line starts with letter ‘#’ and
lasts the whole line. The script engine will completely ignore the comment line and
jump to the next script line once a comment line is detected.
Following script line is treated as comment:
# This is an example of comment line
3.3.6.2.3 Variables
RN4020 script engine defines two variables: $VAR1 and $VAR2. Variable names are
case sensitive. The value of the variables could be assigned to a constant value, or a
value that is returned by an AT command. For instance, following script line assigns
value 0x1234 to variable $VAR1:
$VAR = “1234”
Similarly, following script line assign the reading of AIO 1 to variable $VAR2: