Specifications
7.4. SOFTWARE DESIGN
will await further instruction f rom the host application.
SMS
If the application requests an SMS check, the GSM FSM extracts a list of
received SMSs from the module and stores the contents of the first SMS in
a global array for processing by the host application. All received SMSs are
then deleted from the module’s memory. Thus, if multiple SMSs are sent
between checks, only the first one is read and processed. All subsequent
SMSs are ignored.
7.4.8 Report Generation FSM
The system operator can decide how often they would like the device to
upload captured data by setting a threshold on the number of records which
must be captured before the device begins the upload process . This value is
stored in a global variable. Up to 256 records are allowed (it is an eight bit
number). Whenever a new record is stored, a record index is incremented.
This index value is constantly compared to the upload threshold. If it is
equal-to, or exceeds the threshold (and no upload is currently in progress),
then the upload FSM is initiated.
While in the “sending data” state, this FSM constantly checks the GSM
FSM for status changes in order to initiate a GPRS attach and the email
transmission. When the GSM FSM reports that it is ready to compose
the email, all data records are delivered across the USART, including a
system status and settings report. This ensures that if any SMS configuration
changes were processed, that the results are reported to the operator. The
format of this data is human-readable ASCII values in fixed-width columns.
If the GSM FSM reports that the email was delivered succes sfully, all
records are cleared. Otherwise the system shuts down the GSM connection
and waits five minutes bef ore retrying. It retries indefinitely until the report
is successfully delivered.
84