1 /*
2  * Copyright (c) 2022 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 /**
17  * @file light_agent.h
18  *
19  * @brief Declares the functions for starting or stopping a light.
20  * @since 10
21  */
22 
23 #ifndef LIGHT_AGENT_H
24 #define LIGHT_AGENT_H
25 
26 #include "light_agent_type.h"
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
32 namespace OHOS {
33 namespace Sensors {
34 /**
35  * @brief Obtains information about all the lights in the system.
36  *
37  * @param lightInfo Indicates the list of the light information.
38  * @param count Indicates the count of all the lights in the system.
39  * @return Returns <b>0</b> if the operation is successful.
40  * @return Returns a negative value if the operation fails.
41  * @since 10
42  */
43 int32_t GetLightList(LightInfo **lightInfo, int32_t &count);
44 
45 /**
46  * @brief Turns on available lights in the list based on the specified light id.
47  *
48  * @param lightId Indicates the light id.
49  * @param color:Color corresponding to the light.
50  * @param animation Indicates the blinking parameters.
51  * @return Returns <b>0</b> if the operation is successful.
52  * @return Returns a negative value if the operation fails.
53  * @since 10
54  */
55 int32_t TurnOn(int32_t lightId, const LightColor &color, const LightAnimation &animation);
56 
57 /**
58  * @brief Turns off available lights in the list based on the specified light id.
59  *
60  * @param lightId Indicates the light id.
61  * @return Returns <b>0</b> if the operation is successful.
62  * @return Returns a negative value if the operation fails.
63  * @since 10
64  */
65 int32_t TurnOff(int32_t lightId);
66 } // namespace Sensors
67 } // namespace OHOS
68 #ifdef __cplusplus
69 };
70 #endif
71 /** @} */
72 #endif // endif LIGHT_AGENT_H
73