BIO Watcher Overview

The BIO Watcher component is part of the Watcher Framework that handles BIO messages that come from the SMS and WAP stack.

Purpose

To handle BIO messages that come from the SMS stack and WAP stack.

Key terms

Replace-type-messages

Replace-type-messages are SMS messages received from the service centre, where the protocol identifier contains a Replace Short Message Type code.

BIO message

Bearer Independent Objects (BIO) messages contain data that can be received and interpreted by the device, see BIO Watcher Framework for more details.

Architecture

BIO Watcher is made of two watchers—NBS Watcher and WAP Watcher. The Watcher Framework supports both of them.

NBS watcher: The NBS watcher handles the reception of SMS messages. When initialised by Watcher Framework, the watcher queries the BIO Messaging database for BIO messages that are of type ENbs. For each of these BIO messages, the watcher creates an object that opens a connection to the SMS stack and waits for the particular message type. The message types are either defined by the port number that the message is received on or by a string to watch for at the start of the message.

When the NBS Watcher receives a non-class 2 SMS message, it creates a new entry under the global inbox in the Message Store. For class 2 messages, the entry is created in the class 2 folder as defined by the SMS settings, which can be the global inbox. The details field of the entry is used to store the phone number of the incoming message or the name of the sender (provided if the watcher finds a match for the phone number in the contacts database). The description field is used to store the first N characters of the SMS message, where N is defined in the SMS settings, or for BIO messages, the description as retrieved from the BIO database. BIO messages also have the BioType field set to the UID of the BIO message as retrieved from the BIO database. The CSmsHeader class, which is a wrapper around the CSmsMessage class provided by the SMS Stack component, is used to externalise the SMS message to the entry’s CMsvStore. The watcher also places a copy of the body text of the message in the rich text stream of the entry’s CMsvStore.

The NBS Watcher is also responsible for handing the following special SMS types:

  • Replace type messages: When the watcher receives a replace type message, it scans the folder (where the message is delivered to) for messages that have a matching protocol ID and from address. For each of the messages, it checks the time stamps from the service centre and discards the older message.

  • Message indications: The watcher can listen for incoming message waiting indications. The CSmsSettings class defines whether the watcher listens and delivers the messages to the Inbox or discards them. If the watcher is configured to listen for messages, it uses the SMS utilities in the SMS Client MTM to decode the message to determine the notification type and number of messages.

  • Delivery reports: The watcher can be configured to listen to the delivery reports. The SMS utilities get a string from the SMSs.rss resource file to generate descriptions and details fields to store with SMS messages.

WAP watcher: The WAP watcher listens for incoming messages from the WAP stack using the WAP Message API. To determine ports to listen for messages, the watcher queries the BIO database for BIO message types—EWsp, EWspSecure, EWap, EWapSecure and registers them as an observer of the BIO database. It listens for new BIO message with these types when they are added. The watcher stores the messages in the global inbox tagged with the BIO type listed in the BIO database.

Note: The Symbian platform provides the preceding two watchers, but licensees can write their own watchers.