Class Led
Definition
- Assembly:
- Tizen.System.dll
The LED class provides the properties and methods to control the attached LED device.
public static class Led
- Inheritance
-
objectLed
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 |
---|---|
int |
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 |
---|---|
System.ArgumentException | When an invalid parameter value is set. |
System.UnauthorizedAccessException | If the privilege is not set. |
System.NotSupportedException | In case the device does not support this behavior. |
MaxBrightness
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 |
---|---|
int |
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.
Exceptions
Type | Condition |
---|---|
System.ArgumentException | When an invalid parameter value is set. |
System.UnauthorizedAccessException | If the privilege is not set. |
System.NotSupportedException | In case the device does not support this behavior. |
Methods
View SourcePlay(int, int, 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 |
---|---|---|
int | on | Turn on time in milliseconds. |
int | 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. |
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
try
{
Led.Play(500, 200, Color.FromRgba(255, 255, 255, 1));
}
Catch(Exception e)
{
}
Exceptions
Type | Condition |
---|---|
System.ArgumentException | When an invalid parameter value is set. |
System.UnauthorizedAccessException | If the privilege is not set. |
System.InvalidOperationException | In case of any system error. |
System.NotSupportedException | In case the device does not support this behavior. |
Stop()
Stops the LED that is located at the front of the device.
Declaration
public static void Stop()
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
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 |
---|---|
System.UnauthorizedAccessException | If the privilege is not set. |
System.InvalidOperationException | In case of any system error. |
System.NotSupportedException | In case the device does not support this behavior. |
Events
View SourceBrightnessChanged
StateChanged is raised when the LED state is changed.
Declaration
public static event EventHandler<LedBrightnessChangedEventArgs> BrightnessChanged
Event Type
Type | Description |
---|---|
System.EventHandler<TEventArgs><LedBrightnessChangedEventArgs> |
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.