beautypg.com

Sierra Wireless DART 200 CDPD Modem User Manual

Page 98

background image

DART 200 CDPD Modem User’s Guide

8 Application Programming

Sierra Wireless, Inc.

8-4

Error recovery

Good application design includes provisions for handling errors. Insert
code to perform the error-handling function after every operation where
an error might occur, such as after every AT command, where the most
likely failure is modem power loss, and after every communications
operation where these five distinct errors are possible:

1. Loss of modem power.

2. Loss of radio signal.

3. Loss of network registration.

4. Loss of host connection (does not apply to UDP).

5. Loss of online mode (a power reset has occurred).

Failure of a communications operation (usually send or receive) is
indicated by:

Send - A time out or an error response

Receive - A time out

If the MAS is capable of sensing signal status over the RS-232 interface
then testing for loss of signal, registration, or connection can be done (if
desired) before attempting the send/receive operation. If it is not (or the
application designer chooses not to sense prior to I/O operations), then
testing follows failures only.

There is no specific test for loss of modem power. If the modem is in
online mode, and the application does not get an OK or 0 response to the
escape sequence, then power loss can be assumed. Similarly, if the
modem is in command mode and the application fails to get the expected
response to an

AT command, then power loss can be assumed.

Status information and error codes, to be analyzed to determine
appropriate error recovery actions, can be obtained from the Data Set
Ready (DSR) and Data Carrier Detect (DCD) signals, or from Status
(S-)Registers 56, 57, 62, 63, 101, 102 and 126. The use of DSR and DCD
for basic status sensing is recommended (if the MAS supports it) for both
speed and simplicity. The available information, by source, is
summarized below.

DCD - This signal can be set up at modem initialization time to
follow the state of the connection established condition (&C1), the
state of the RF in range condition (&C3), or the modem’s
registration state (&C4). The default is &C1

DSR - This signal can be set up at modem initialization time to
follow the state of the connection established condition (&S1), the
state of the RF in range condition (&S2), or the modem’s registration
state (&S3). The default is

&S0

(always active)