- When the AT command handler starts, it registers for new message indications using the AT+CNMI command. This causes the phone device to send +CMTI indications whenever a new message arrives at the device.
- When +CMTI is detected by SMSRequestAt::notification the AT command handler initiates the message count check - SMSRequestAt::check. Once the check completes, the number of messages is transmitted to the application via the SMSRequestPrivate::messageCount signal.
Note: An alternative device handler would similarly need to arrange for the SMSRequestPrivate::messageCount signal to be emitted when new messages arrive.
- The SMSRequestPrivate::messageCount signal is broadcast on the QPE/Phone QCop channel.
Note: Applications listen on this channel to receive notification of new messages. More than one application can listen for new message notifications, but only one (usually the mail client) should subsequently retrieve the message contents.
- When the mail client receives the signal, it calls the SMSRequest::firstMessage and SMSRequest::nextMessage methods to retrieve the SMS message contents from the incoming queue.
- Each message is returned to the application via the SMSRequestPrivate::fetched signal.
- Finally, once the message is received by the application it is deleted from the incoming queue using SMSRequest::deleteMessage.
- The application saves the message in another location so that the message is never permanently lost and the message store in the device is treated as a temporary buffer.
Note: Signals rather than function returns are used to pass messages and status reports back to the application. This is because the entire phone system is asynchronous and the information may not be available when the request is made and must be transmitted later.