Class Led
Definition
- Namespace:
- Tizen.System
- Assembly:
- Tizen.System.dll
- API Level:
- 3
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/led
The LED class provides the properties and methods to control the attached LED device.
public static class Led
- Inheritance
-
Led
Remarks
The LED API provides the way to control the attached LED device, such as the camera flash and service LED. It supports to turn on the camera flash and set the pattern to the service LED which is located at the front of the device. Related features: http://tizen.org/feature/led http://tizen.org/feature/camera.back.flash It is recommended to design the feature related codes in your application for reliability. You can check if a device supports the related features for this API by using system information, thereby controlling the procedure of your application.
Examples
Console.WriteLine("Led MaxBrightness is: {0}", Tizen.System.Led.MaxBrightness);
Console.WriteLine("Led current Brightness is: {0}", Tizen.System.Led.Brightness);
Properties
View SourceBrightness
Gets the brightness value of the LED that is located next to the camera.
Declaration
public static int Brightness { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
Remarks
The brightness value range of the LED is 0 to Tizen.System.Led.MaxBrightness value. Changing the brightness value will invoke the registered EventHandler for the LED BrightnessChanged (if any).
Examples
Console.WriteLine("Led current Brightness is: {0}", Tizen.System.Led.Brightness);
Tizen.System.Led.Brightness = 50;
Console.WriteLine("Led current Brightness is: {0}", Tizen.System.Led.Brightness);
Exceptions
Type | Condition |
---|---|
ArgumentException | When an invalid parameter value is set. |
UnauthorizedAccessException | If the privilege is not set. |
NotSupportedException | In case the device does not support this behavior. |
API Level: 3
View SourceMaxBrightness
Gets the maximum brightness value of the LED that is located next to the camera.
Declaration
public static int MaxBrightness { get; }
Property Value
Type | Description |
---|---|
Int32 |
Exceptions
Type | Condition |
---|---|
ArgumentException | When an invalid parameter value is set. |
UnauthorizedAccessException | If the privilege is not set. |
NotSupportedException | In case the device does not support this behavior. |
API Level: 3
Methods
View SourcePlay(Int32, Int32, Color)
Plays the LED that is located at the front of the device.
Declaration
public static void Play(int on, int off, Color color)
Parameters
Type | Name | Description |
---|---|---|
Int32 | on | Turn on time in milliseconds. |
Int32 | off | Turn off time in milliseconds. |
Color | color | The Color value The first byte means opaque and the other 3 bytes are the RGB values. |
Examples
try
{
Led.Play(500, 200, Color.FromRgba(255, 255, 255, 1));
}
Catch(Exception e)
{
}
Exceptions
Type | Condition |
---|---|
ArgumentException | When an invalid parameter value is set. |
UnauthorizedAccessException | If the privilege is not set. |
InvalidOperationException | In case of any system error. |
NotSupportedException | In case the device does not support this behavior. |
API Level: 3
View SourceStop()
Stops the LED that is located at the front of the device.
Declaration
public static void Stop()
Examples
try
{
Led.Play(500, 200, Color.FromRgba(255, 255, 255, 1));
//wait for a while and stop...
Led.Stop();
}
Catch(Exception e)
{
}
Exceptions
Type | Condition |
---|---|
UnauthorizedAccessException | If the privilege is not set. |
InvalidOperationException | In case of any system error. |
NotSupportedException | In case the device does not support this behavior. |
API Level: 3
Events
View SourceBrightnessChanged
StateChanged is raised when the LED state is changed.
Declaration
public static event EventHandler<LedBrightnessChangedEventArgs> BrightnessChanged
Event Type
Type | Description |
---|---|
EventHandler<LedBrightnessChangedEventArgs> |