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.
C#Copypublic static class Led
- Inheritance
-
System.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
CopyConsole.WriteLine("Led MaxBrightness is: {0}", Tizen.System.Led.MaxBrightness); Console.WriteLine("Led current Brightness is: {0}", Tizen.System.Led.Brightness);
Properties
Declaration
C#Copypublic static int Brightness { get; set; }
Property Value
Type | Description |
---|---|
System.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
CopyConsole.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. |
UnauthorizedAccessException | If the privilege is not set. |
System.NotSupportedException | In case the device does not support this behavior. |
API Level: 3
MaxBrightness
Gets the maximum brightness value of the LED that is located next to the camera.
Declaration
C#Copypublic static int MaxBrightness { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | When an invalid parameter value is set. |
UnauthorizedAccessException | If the privilege is not set. |
System.NotSupportedException | In case the device does not support this behavior. |
API Level: 3
Methods
Declaration
C#Copypublic static void Play(int on, int off, Color color)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | on | Turn on time in milliseconds. |
System.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
Copytry { 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. |
UnauthorizedAccessException | If the privilege is not set. |
InvalidOperationException | In case of any system error. |
System.NotSupportedException | In case the device does not support this behavior. |
API Level: 3
Declaration
C#Copypublic static void Stop()
Examples
Copytry { 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. |
System.NotSupportedException | In case the device does not support this behavior. |
API Level: 3
Events
Declaration
C#Copypublic static event EventHandler<LedBrightnessChangedEventArgs> BrightnessChanged
Event Type
Type | Description |
---|---|
System.EventHandler<LedBrightnessChangedEventArgs> |