2 * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 #ifndef __TIZEN_SYSTEM_LED_H__
19 #define __TIZEN_SYSTEM_LED_H__
21 #include "device-error.h"
29 * @addtogroup CAPI_SYSTEM_DEVICE_LED_MODULE
34 * @brief Gets the max brightness value of a LED that is located next to the camera.
38 * @privilege %http://tizen.org/privilege/led
40 * @param[out] max_brightness The max brightness value of the LED
42 * @return @c 0 on success,
43 * otherwise a negative error value
45 * @retval #DEVICE_ERROR_NONE Successful
46 * @retval #DEVICE_ERROR_INVALID_PARAMETER Invalid parameter
47 * @retval #DEVICE_ERROR_PERMISSION_DENIED Permission denied
48 * @retval #DEVICE_ERROR_OPERATION_FAILED Operation failed
49 * @retval #DEVICE_ERROR_NOT_SUPPORTED Not supported device
51 int device_flash_get_max_brightness(int *max_brightness);
54 * @brief Gets the brightness value of a LED that is located next to the camera.
58 * @privilege %http://tizen.org/privilege/led
60 * @param[out] brightness The brightness value of LED (@c 0 ~ MAX)
62 * @return @c 0 on success,
63 * otherwise a negative error value
65 * @retval #DEVICE_ERROR_NONE Successful
66 * @retval #DEVICE_ERROR_INVALID_PARAMETER Invalid parameter
67 * @retval #DEVICE_ERROR_PERMISSION_DENIED Permission denied
68 * @retval #DEVICE_ERROR_OPERATION_FAILED Operation failed
69 * @retval #DEVICE_ERROR_NOT_SUPPORTED Not supported device
71 int device_flash_get_brightness(int *brightness);
74 * @brief Sets the brightness value of a LED that is located next to the camera.
78 * @privilege %http://tizen.org/privilege/led
80 * @param[in] brightness The brightness value of LED (@c 0 ~ MAX)
82 * @return @c 0 on success,
83 * otherwise a negative error value
85 * @retval #DEVICE_ERROR_NONE Successful
86 * @retval #DEVICE_ERROR_INVALID_PARAMETER Invalid parameter
87 * @retval #DEVICE_ERROR_PERMISSION_DENIED Permission denied
88 * @retval #DEVICE_ERROR_OPERATION_FAILED Operation failed
89 * @retval #DEVICE_ERROR_NOT_SUPPORTED Not supported device
91 int device_flash_set_brightness(int brightness);
94 * @brief Enumeration for custom LED flags.
98 LED_CUSTOM_DUTY_ON = 1 << 0, /**< blink LED */
99 LED_CUSTOM_DEFAULT = (LED_CUSTOM_DUTY_ON), /**< Default flag */
103 * @brief Plays the custom effect of the service LED that is located to the front of a device.
107 * @privilege %http://tizen.org/privilege/led
109 * @param[in] on Turn on time in milliseconds
110 * @param[in] off Turn off time in milliseconds
111 * @param[in] color The Color value \n
112 * The first byte means opaque and the other 3 bytes are RGB values.
113 * @param[in] flags The combination of enum #led_custom_flags
115 * @return @c 0 on success,
116 * otherwise a negative error value
118 * @retval #DEVICE_ERROR_NONE Successful
119 * @retval #DEVICE_ERROR_INVALID_PARAMETER Invalid parameter
120 * @retval #DEVICE_ERROR_PERMISSION_DENIED Permission denied
121 * @retval #DEVICE_ERROR_OPERATION_FAILED Operation failed
122 * @retval #DEVICE_ERROR_NOT_SUPPORTED Not supported device
124 int device_led_play_custom(int on, int off, unsigned int color, unsigned int flags);
127 * @brief Stops the custom effect of the service LED that is located to the front of a device.
131 * @privilege %http://tizen.org/privilege/led
133 * @return @c 0 on success,
134 * otherwise a negative error value
136 * @retval #DEVICE_ERROR_NONE Successful
137 * @retval #DEVICE_ERROR_INVALID_PARAMETER Invalid parameter
138 * @retval #DEVICE_ERROR_PERMISSION_DENIED Permission denied
139 * @retval #DEVICE_ERROR_OPERATION_FAILED Operation failed
140 * @retval #DEVICE_ERROR_NOT_SUPPORTED Not supported device
142 int device_led_stop_custom(void);
152 #endif // __TIZEN_SYSTEM_LED_H__