The conditions for starting USB services

This document describes the conditions that serve as triggers for starting USB services in a Symbian platform phone.

Purpose

USB services need to be started in response to certain conditions. For example, on a peripheral-only phone, USB services can be started in response to a cable-insertion event, or possibly in response to a user instruction (in other words a function call from the phone's user interface).

On an On-The-Go (OTG) phone, the starting conditions are more complicated. All the conditions are described below.

Intended Audience

This document is for Symbian licensees who are implementing USB services, including host and On-The-Go (OTG) services, on a Symbian device.

Required Background

For details of, and links to, the USB and OTG specifications on the USB Implementers Forum website, see The USB Manager library.

If the Symbian platformphone you are developing code for support USB host/OTG services, then you need a thorough understanding of the USB host/OTG specification.

USB peripheral-only phones

On a USB peripheral-only phone (in other words, a phone that will not support OTG services), the application that you start USB services from needs to monitor for when a USB cable has been inserted. For information on how to monitor for this, see Monitoring the phone's USB hardware.

The phone can also use the USB Manager's VBus publish-and-subscribe key to monitor VBus. (For information about using this property key, see Monitoring whether VBus is powered.) When the VBus property key indicates that VBus is powered, this means that a remote USB host wants the phone to perform as its peripheral. Therefore, it is time to start USB services.

USB host/OTG phones

On a USB host/On-The-Go (OTG) phone, when your USB control application detects any of the conditions listed below, it must start USB services.

Note: Whatever condition you are responding to (in the USB control application) as a trigger for starting USB services, you must start USB services before you call either of the USB Manager functions that can result in the phone becoming a USB host. (These functions are: RUsb::BusRequest() or RUsb::BusRespondSrp(); see Controlling when the phone is the USB host.) The reason you must start USB services before calling these functions is that the phone must be ready to perform USB communication as soon as it becomes host.

If the Symbian platformphone you are configuring is: