The Led API provides functions to control the attached led device.
Required Header
#include <device/led.h>
Overview
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 to the front of a device.
Related Features
This API is related with the following features:
It is recommended to design 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.
To ensure your application is only running on the device with specific features, please define the features in your manifest file using the manifest editor in the SDK.
More details on featuring your application can be found from feature element description.
Functions |
int | device_flash_get_max_brightness (int *max_brightness) |
| Gets the max brightness value of a LED that is located next to the camera.
|
int | device_flash_get_brightness (int *brightness) |
| Gets the brightness value of a LED that is located next to the camera.
|
int | device_flash_set_brightness (int brightness) |
| Sets the brightness value of a LED that is located next to the camera.
|
int | device_led_play_custom (int on, int off, unsigned int color, unsigned int flags) |
| Plays the custom effect of the service LED that is located to the front of a device.
|
int | device_led_stop_custom (void) |
| Stops the custom effect of the service LED that is located to the front of a device.
|
Enumeration Type Documentation
Enumeration for custom LED flags.
- Since :
- 2.3
- Enumerator:
LED_CUSTOM_DUTY_ON |
blink LED
|
LED_CUSTOM_DEFAULT |
Default flag
|
Function Documentation
Gets the brightness value of a LED that is located next to the camera.
- Since :
- 2.3
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/led
- Parameters:
-
[out] | brightness | The brightness value of LED (0 ~ MAX) |
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
Gets the max brightness value of a LED that is located next to the camera.
- Since :
- 2.3
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/led
- Parameters:
-
[out] | max_brightness | The max brightness value of the LED |
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
Sets the brightness value of a LED that is located next to the camera.
- Since :
- 2.3
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/led
- Parameters:
-
[in] | brightness | The brightness value of LED (0 ~ MAX) |
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
Plays the custom effect of the service LED that is located to the front of a device.
- Since :
- 2.3
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/led
- Parameters:
-
[in] | on | Turn on time in milliseconds |
[in] | off | Turn off time in milliseconds |
[in] | color | The Color value
The first byte means opaque and the other 3 bytes are RGB values |
[in] | flags | The combination of enum led_custom_flags |
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
Stops the custom effect of the service LED that is located to the front of a device.
- Since :
- 2.3
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/led
- Returns:
0
on success, otherwise a negative error value
- Return values:
-