device: Change profile version from header files
[platform/core/api/device.git] / include / led.h
1 /*
2  * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17
18 #ifndef __TIZEN_SYSTEM_LED_H__
19 #define __TIZEN_SYSTEM_LED_H__
20
21
22 #include "device-error.h"
23
24
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28
29
30 /**
31  * @addtogroup CAPI_SYSTEM_DEVICE_LED_MODULE
32  * @{
33  */
34
35
36 /**
37  * @brief Gets the max brightness value of a LED that is located next to the camera.
38  * @since_tizen 2.3
39  * @privlevel public
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
50  */
51 int device_flash_get_max_brightness(int *max_brightness);
52
53
54 /**
55  * @brief Gets the brightness value of a LED that is located next to the camera.
56  * @since_tizen 2.3
57  * @privlevel public
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
68  */
69 int device_flash_get_brightness(int *brightness);
70
71
72 /**
73  * @brief Sets the brightness value of a LED that is located next to the camera.
74  * @since_tizen 2.3
75  * @privlevel public
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
88  */
89 int device_flash_set_brightness(int brightness);
90
91
92 /**
93  * @brief Enumeration for custom LED flags.
94  * @since_tizen 2.3
95  */
96 typedef enum {
97     LED_CUSTOM_DUTY_ON = 1 << 0, /**< blink LED */
98     LED_CUSTOM_DEFAULT = (LED_CUSTOM_DUTY_ON), /**< Default flag */
99 } led_custom_flags;
100
101
102 /**
103  * @brief Plays the custom effect of the service LED that is located to the front of a device.
104  * @since_tizen 2.3
105  * @privlevel public
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
120  */
121 int device_led_play_custom(int on, int off, unsigned int color, unsigned int flags);
122
123
124 /**
125  * @brief Stops the custom effect of the service LED that is located to the front of a device.
126  * @since_tizen 2.3
127  * @privlevel public
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
137  */
138 int device_led_stop_custom(void);
139
140
141 /**
142  * @}
143  */
144
145
146 #ifdef __cplusplus
147 }
148 #endif
149
150
151 #endif  // __TIZEN_SYSTEM_LED_H__