title SimpleSBDQueue Startup

Program->Controller: Construct
Program->Controller: Subscribe to Command Complete event
Program->Controller: Subscribe to Incoming Packet event
Program->Controller: Subscribe to Outgoing Packet Status event
Program->+Controller: Initialize
Controller->Communicator: Construct
Controller->Communicator: Subscribe to Received Packet event
Controller->Communicator: Subscribe to Request Data to Transmit event
Controller->Communicator: Subscribe to Sent Data event
Controller->Communicator: Subscribe to Statistics event
Controller->+Communicator: Initialize
note over Communicator: Start background thread
Communicator-->-Controller:
Controller-->-Program:

note over Communicator: Execution continues on background thread and loops

Communicator->+Communicator: Background thread

Communicator->Iridium Modem: Power on
Communicator->SBDModem: Construct
Communicator->+SBDModem: Initialize
SBDModem->SerialPort: Construct
SBDModem->SerialPort: Open
SBDModem->SerialListener: Construct
SBDModem->SerialListener: Subscribe to data received event
SBDModem->+SerialListener: Initialize
note over SerialListener: Start background thread
SerialListener-->-SBDModem:
SBDModem-->-Communicator:

note over SerialListener: Execute continues on a background thread and loops
SerialListener->+SerialListener: Background thread
SerialListener->SerialPort: Configures read to wake up when there is a time gap in the data
SerialListener->SerialPort: Read
SerialListener->SBDModem: Report data received through event mechanism
SerialListener-->-SerialListener:

Communicator->+SBDModem: ConfigureInterface
SBDModem->Iridium Modem: ATE0V1
Iridium Modem->SBDModem: OK
SBDModem-->-Communicator:

Communicator->+SBDModem: GetModel
SBDModem->Iridium Modem: AT+CGMI
Iridium Modem->SBDModem: 9522B
Iridium Modem->SBDModem: OK
SBDModem-->-Communicator:

Communicator->+SBDModem: ClearSBDBuffer (transmit)
SBDModem->Iridium Modem: AT+SBDD1
Iridium Modem->SBDModem: OK
SBDModem-->-Communicator:

Communicator->+SBDModem: ExecuteSession
SBDModem->Iridium Modem: AT+SBDIX=(length)
Iridium Modem->SBDModem: READY
SBDModem->Iridium Modem: (packet data, checksum)
Iridium Modem->SBDModem: +SBDIX:(status)



