SARA-R42 - Application note
UBX-20050829 - R02
AT commands response parser
Page 12 of 58
C1-Public
4
AT commands response parser
It is important that the user implements a dedicated AT parser component in the host application.
Basic guidelines:
•
When entering AT commands, spaces are ignored.
•
The DTE shall handle the case of unexpected spaces or line endings, i.e. the <CR><LF> characters.
•
As suggested in the SARA-R4 series AT commands manual
, always wait for at least 20 ms
following a final result code or a URC reception before issuing a new AT command.
•
When the module has finished processing an AT command, it will output a final result code (either
OK or ERROR) indicating that it is ready to accept a new AT command. The information text
responses are issued before the final result code. CMEE setting to numeric or verbose
value (for example,
AT+CMEE=1
or
AT+CMEE=2
).
•
Asynchronous commands (for example,
+UMQTTC
) return an immediate final result code and final
result via URC.
•
Some AT commands return an intermediate result code (IRC) during command execution.
☞
Due to interface restrictions, when using multiple AT command interfaces, the parser should take
into account that in SARA-R42 series it is not possible to have parallel activity on two or more AT
terminals. Basically this behavior can be detected in the following configurations:
o
double UART availability, i.e.
+USIO:1
;
o
virtual channels set through multiplexer (MUX).
The only allowed parallel activity is present when it is defined a system architecture with a PPP
dial-up on one port and AT commands on the other one.
4.1
Operational modes of the AT interface
When implementing the AT parser, it is important to consider that the communication port, whether
the main UART or a MUX virtual port, enters different operational modes while processing AT
commands.
In command mode, the module (called DCE
–
data communication equipment) can receive AT
commands. Once an AT command is detected on the AT interface, the DCE processes it and may
return to command mode by issuing a success or error response. Special AT commands lead the AT
interface into intermediate states where, for example, an SMS payload is expected, or raw/binary data
is exchanged (for example, during file transfer), or PPP packets are exchanged. In the latter case, the
PPP data mode can be temporarily exited by a special
+++
packet or DTR line ON-to-OFF transition
and the online command mode (OLCM) state is entered: from this state, which is similar to the
command mode, the DCE can be moved back to PPP data mode via
ATO
command or can disconnect
PPP via
ATH
command (having previously applied
AT+CVHU=0
as mandatory setting).
depicts the various modes in which the module can operate and shows the actions that cause
transitions between the different modes. The transitions triggered by DTR line changes are
configurable with the
AT&D
command, see SARA-R4 series AT commands manual
For more details about the AT command interface settings, see the AT command settings section in
the SARA-R4 series AT commands manual