net.rim.device.api.accessory
Class CradleProtocol

java.lang.Object
  extended by net.rim.device.api.accessory.CradleProtocol

public class CradleProtocol
extends Object

Provides the ability to communicate with a cradle and discover its type and properties.

Since:
BlackBerry API 6.0.0

Field Summary
static int PROPERTY_AC_CHARGING
          Property flag specifying that the cradle has AC power charge capability.
static int PROPERTY_BUTTONS_OTHER
          Property flag specifying that the cradle has buttons for application use.
static int PROPERTY_BUTTONS_PROXY
          Property flag specifying that the cradle has buttons that will be automatically converted into BlackBerry device keystrokes.
static int PROPERTY_LIGHT
          Property flag specifying that the cradle has a light feature.
static int PROPERTY_USB_PASSTHROUGH
          Property flag specifying that the cradle has a USB passthrough feature.
static int TYPE_AUDIO
          Constant specifying that an audio cradle is connected.
static int TYPE_BEDSIDE
          Constant specifying that a bedside cradle is connected.
static int TYPE_CAR_KIT
          Constant specifying that a car kit cradle is connected.
static int TYPE_CHARGER
          Constant specifying that a charger cradle is connected.
static int TYPE_DESKTOP
          Constant specifying that a desktop cradle is connected.
static int TYPE_HOLSTER
          Constant specifying that a holster cradle is connected.
static int TYPE_MULTIMEDIA
          Constant specifying that a multimedia cradle is connected.
static int TYPE_NONE
          Constant specifying that no cradle is connected.
static int TYPE_SIMPLE
          Constant specifying that a simple cradle is connected.
 
Method Summary
 boolean communicationSupported()
          Determines whether the connected cradle supports communication.
 int getCradleType()
          Returns the type of the currently connected cradle.
static CradleProtocol getInstance()
          Returns a CradleProtocol singleton instance.
 boolean hasProperty(int prop)
          Determines whether a connected cradle has a specified property.
 boolean isCradleConnected()
          Determines whether a cradle is currently connected.
 boolean isCradleDetectionSupported()
          Determines whether the device can detect a connected cradle accessory.
 boolean isNfcConnection()
          Determines whether the cradle is connected through the Near Field Communication (NFC) radio protocol.
 boolean isUsbConnection()
          Determines whether the cradle is connected through a USB connector.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 



Field Detail

TYPE_NONE

public static final int TYPE_NONE
Constant specifying that no cradle is connected.

See Also:
Constant Field Values
Since:
BlackBerry API 6.0.0

TYPE_SIMPLE

public static final int TYPE_SIMPLE
Constant specifying that a simple cradle is connected.

A simple cradle can be of any functional type. It is less expensive to manufacture than a "smart" cradle, which can report its type.

See Also:
Constant Field Values
Since:
BlackBerry API 6.0.0

TYPE_HOLSTER

public static final int TYPE_HOLSTER
Constant specifying that a holster cradle is connected.

The holster cradle assumes that the user cannot interact with the BlackBerry device.

See Also:
Constant Field Values
Since:
BlackBerry API 6.0.0

TYPE_CAR_KIT

public static final int TYPE_CAR_KIT
Constant specifying that a car kit cradle is connected.

See Also:
Constant Field Values
Since:
BlackBerry API 6.0.0

TYPE_DESKTOP

public static final int TYPE_DESKTOP
Constant specifying that a desktop cradle is connected.

See Also:
Constant Field Values
Since:
BlackBerry API 6.0.0

TYPE_BEDSIDE

public static final int TYPE_BEDSIDE
Constant specifying that a bedside cradle is connected.

See Also:
Constant Field Values
Since:
BlackBerry API 6.0.0

TYPE_CHARGER

public static final int TYPE_CHARGER
Constant specifying that a charger cradle is connected.

See Also:
Constant Field Values
Since:
BlackBerry API 6.0.0

TYPE_AUDIO

public static final int TYPE_AUDIO
Constant specifying that an audio cradle is connected.

See Also:
Constant Field Values
Since:
BlackBerry API 6.0.0

TYPE_MULTIMEDIA

public static final int TYPE_MULTIMEDIA
Constant specifying that a multimedia cradle is connected.

See Also:
Constant Field Values
Since:
BlackBerry API 6.0.0

PROPERTY_AC_CHARGING

public static final int PROPERTY_AC_CHARGING
Property flag specifying that the cradle has AC power charge capability.

See Also:
Constant Field Values
Since:
BlackBerry API 6.0.0

PROPERTY_BUTTONS_OTHER

public static final int PROPERTY_BUTTONS_OTHER
Property flag specifying that the cradle has buttons for application use.

Unlike with CradleProtocol.PROPERTY_BUTTONS_PROXY, the buttons will not be automatically processed by the BlackBerry device. An application would have to use its cradle communication protocol to read keystrokes.

See Also:
Constant Field Values
Since:
BlackBerry API 6.0.0

PROPERTY_BUTTONS_PROXY

public static final int PROPERTY_BUTTONS_PROXY
Property flag specifying that the cradle has buttons that will be automatically converted into BlackBerry device keystrokes.

See Also:
Constant Field Values
Since:
BlackBerry API 6.0.0

PROPERTY_LIGHT

public static final int PROPERTY_LIGHT
Property flag specifying that the cradle has a light feature.

See Also:
Constant Field Values
Since:
BlackBerry API 6.0.0

PROPERTY_USB_PASSTHROUGH

public static final int PROPERTY_USB_PASSTHROUGH
Property flag specifying that the cradle has a USB passthrough feature.

See Also:
Constant Field Values
Since:
BlackBerry API 6.0.0


Method Detail

getInstance

public static CradleProtocol getInstance()
Returns a CradleProtocol singleton instance.

Since:
BlackBerry API 6.0.0

getCradleType

public int getCradleType()
Returns the type of the currently connected cradle.

Returns:
One of the TYPE_* constants in this class.
Since:
BlackBerry API 6.0.0

isCradleDetectionSupported

public boolean isCradleDetectionSupported()
Determines whether the device can detect a connected cradle accessory.

Returns:
true if the device can detect a connected cradle, false otherwise.
Since:
BlackBerry API 6.0.0

isCradleConnected

public boolean isCradleConnected()
Determines whether a cradle is currently connected.

Returns:
true if connected, false otherwise.
Since:
BlackBerry API 6.0.0

hasProperty

public boolean hasProperty(int prop)
Determines whether a connected cradle has a specified property.

Parameters:
prop - One of the PROPERTY_* constants in this class.
Returns:
true if the device has the prop property, false otherwise.
Since:
BlackBerry API 6.0.0

communicationSupported

public boolean communicationSupported()
Determines whether the connected cradle supports communication.

If a cradle supports communication, applications can send commands that are accessory-specific, such as TURN_LIGHT_ON.

Returns:
true if the cradle supports communication, false otherwise.
Since:
BlackBerry API 6.0.0

isUsbConnection

public boolean isUsbConnection()
Determines whether the cradle is connected through a USB connector.

Returns:
true if connected through USB, false otherwise.
Since:
BlackBerry API 6.0.0

isNfcConnection

public boolean isNfcConnection()
Determines whether the cradle is connected through the Near Field Communication (NFC) radio protocol.

Returns:
true if connected through NFC, false otherwise.
Since:
BlackBerry API 6.0.0





Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal