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__
22 #include "device-error.h"
31 * @addtogroup CAPI_SYSTEM_DEVICE_LED_MODULE
37 * @brief Gets the max brightness value of a LED that is located next to the camera.
40 * @privilege %http://tizen.org/privilege/led
41 * @remarks This API is related to the following feature: %http://tizen.org/feature/camera.back.flash
42 * @param[out] max_brightness The max brightness value of the LED
43 * @return @c 0 on success,
44 * 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);
55 * @brief Gets the brightness value of a LED that is located next to the camera.
58 * @privilege %http://tizen.org/privilege/led
59 * @remarks This API is related to the following feature: %http://tizen.org/feature/camera.back.flash
60 * @param[out] brightness The brightness value of LED (@c 0 ~ MAX)
61 * @return @c 0 on success,
62 * otherwise a negative error value
63 * @retval #DEVICE_ERROR_NONE Successful
64 * @retval #DEVICE_ERROR_INVALID_PARAMETER Invalid parameter
65 * @retval #DEVICE_ERROR_PERMISSION_DENIED Permission denied
66 * @retval #DEVICE_ERROR_OPERATION_FAILED Operation failed
67 * @retval #DEVICE_ERROR_NOT_SUPPORTED Not supported device
69 int device_flash_get_brightness(int *brightness);
73 * @brief Sets the brightness value of a LED that is located next to the camera.
76 * @privilege %http://tizen.org/privilege/led
77 * @remarks Since 2.4, this API check camera flash status whether camera API preempted flash or not, so it could be failed if flash was preempted by camera API. In this case, API will return #DEVICE_ERROR_RESOURCE_BUSY error.
78 * This API is related to the following feature: %http://tizen.org/feature/camera.back.flash
79 * @param[in] brightness The brightness value of LED (@c 0 ~ MAX)
80 * @return @c 0 on success,
81 * otherwise a negative error value
82 * @retval #DEVICE_ERROR_NONE Successful
83 * @retval #DEVICE_ERROR_INVALID_PARAMETER Invalid parameter
84 * @retval #DEVICE_ERROR_PERMISSION_DENIED Permission denied
85 * @retval #DEVICE_ERROR_OPERATION_FAILED Operation failed
86 * @retval #DEVICE_ERROR_NOT_SUPPORTED Not supported device
87 * @retval #DEVICE_ERROR_RESOURCE_BUSY Device or resource busy
89 int device_flash_set_brightness(int brightness);
93 * @brief Enumeration for custom LED flags.
97 LED_CUSTOM_DUTY_ON = 1 << 0, /**< blink LED */
98 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.
106 * @privilege %http://tizen.org/privilege/led
107 * @remarks This API is related to the following feature: %http://tizen.org/feature/led
108 * @param[in] on Turn on time in milliseconds
109 * @param[in] off Turn off time in milliseconds
110 * @param[in] color The Color value \n
111 * The first byte means opaque and the other 3 bytes are RGB values
112 * @param[in] flags The combination of enum #led_custom_flags
113 * @return @c 0 on success,
114 * otherwise a negative error value
115 * @retval #DEVICE_ERROR_NONE Successful
116 * @retval #DEVICE_ERROR_INVALID_PARAMETER Invalid parameter
117 * @retval #DEVICE_ERROR_PERMISSION_DENIED Permission denied
118 * @retval #DEVICE_ERROR_OPERATION_FAILED Operation failed
119 * @retval #DEVICE_ERROR_NOT_SUPPORTED Not supported device
121 int device_led_play_custom(int on, int off, unsigned int color, unsigned int flags);
125 * @brief Stops the custom effect of the service LED that is located to the front of a device.
128 * @privilege %http://tizen.org/privilege/led
129 * @remarks This API is related to the following feature: %http://tizen.org/feature/led
130 * @return @c 0 on success,
131 * otherwise a negative error value
132 * @retval #DEVICE_ERROR_NONE Successful
133 * @retval #DEVICE_ERROR_INVALID_PARAMETER Invalid parameter
134 * @retval #DEVICE_ERROR_PERMISSION_DENIED Permission denied
135 * @retval #DEVICE_ERROR_OPERATION_FAILED Operation failed
136 * @retval #DEVICE_ERROR_NOT_SUPPORTED Not supported device
138 int device_led_stop_custom(void);
151 #endif // __TIZEN_SYSTEM_LED_H__