net.rim.device.api.system
Class LED

java.lang.Object
  |
  +--net.rim.device.api.system.LED

public final class LED
extends Object

Contains LED API constants and methods.

Since:
JDE 3.6.0

Field Summary
static int BRIGHTNESS_100
          LED 100% brightness.
static int BRIGHTNESS_12
          LED 12% brightness.
static int BRIGHTNESS_25
          LED 25% brightness.
static int BRIGHTNESS_50
          LED 50% brightness.
static int STATE_BLINKING
          Turns LED on blinking.
static int STATE_OFF
          Turns LED off.
static int STATE_ON
          Turns LED on solid.
 
Method Summary
static boolean isPolychromatic()
          Returns true if the LED is capable of displaying multiple colors.
static void setColorConfiguration(int onTime, int offTime, int color)
          Configures the LED.
static void setColorPattern(int[] pattern, boolean repeat)
          Configures the LED to light using the pattern provided.
static void setConfiguration(int onTime, int offTime, int brightness)
          Configures the LED.
static void setState(int state)
          Sets the LED state.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STATE_OFF

public static final int STATE_OFF
Turns LED off.
Since:
JDE 3.6.0

STATE_ON

public static final int STATE_ON
Turns LED on solid.
Since:
JDE 3.6.0

STATE_BLINKING

public static final int STATE_BLINKING
Turns LED on blinking.
Since:
JDE 3.6.0

BRIGHTNESS_12

public static final int BRIGHTNESS_12
LED 12% brightness.
Since:
JDE 3.6.0

BRIGHTNESS_25

public static final int BRIGHTNESS_25
LED 25% brightness.
Since:
JDE 3.6.0

BRIGHTNESS_50

public static final int BRIGHTNESS_50
LED 50% brightness.
Since:
JDE 3.6.0

BRIGHTNESS_100

public static final int BRIGHTNESS_100
LED 100% brightness.
Since:
JDE 3.6.0
Method Detail

isPolychromatic

public static boolean isPolychromatic()
Returns true if the LED is capable of displaying multiple colors.
Returns:
True if the LED is capable of displaying multiple colors.
Since:
JDE 4.0.0

setConfiguration

public static void setConfiguration(int onTime,
                                    int offTime,
                                    int brightness)
Configures the LED.

If the LED is capable of displaying multiple colors, calling this method will display red at the specified brightness.

Parameters:
onTime - Time in milliseconds the LED should turn on for if blinking.
offTime - Time in milliseconds the LED should turn off for if blinking.
brightness - One of BRIGHTNESS_12, BRIGHTNESS_25, BRIGHTNESS_50, BRIGHTNESS_100.
Since:
JDE 4.0.2

setColorConfiguration

public static void setColorConfiguration(int onTime,
                                         int offTime,
                                         int color)
Configures the LED.

If the LED is not capable of displaying multiple colors, the color parameter will be ignored, and the LED will display at BRIGHTNESS_25.

Parameters:
onTime - Time in milliseconds the LED should turn on for if blinking.
offTime - Time in milliseconds the LED should turn off for if blinking.
color - Color to use, of the form 0x00RRGGBB.
Since:
JDE 4.0.2

setState

public static void setState(int state)
Sets the LED state.

Parameters:
state - One of STATE_ON, STATE_OFF, STATE_BLINKING.
Since:
JDE 4.0.2

setColorPattern

public static void setColorPattern(int[] pattern,
                                   boolean repeat)
Configures the LED to light using the pattern provided.

This method is only supported if the LED is capable of displaying multiple colors.

The LED pattern is an int array consisting of color/duration/transition tuples. The color is the RGB color (in the form 0x00RRGGBB), the duration is the duration in milliseconds for this color, and the transition is the time to transistion to the next color in milliseconds. So, a pattern to make the LED blink red would look like this: int[] pattern = { 0x007f0000, 150, 50, 0x00000000, 5850, 50 };

Parameters:
pattern - The LED pattern.
repeat - If true, the pattern is repeated continuously. The pattern can be stopped by calling setState( STATE_OFF ).
Since:
JDE 4.0.2


Copyright 1999-2004 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.