2 * Copyright (c) 2016 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 #include "zb-common.h"
20 API int zb_zcl_ccontrol_move_to_hue(zb_zigbee_h handle, zb_nwk_addr addr16,
21 unsigned char ep, unsigned char hue, unsigned char direction,
22 unsigned short transition_time)
24 int ret = ZIGBEE_ERROR_NONE;
25 CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
26 RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
27 RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
28 RETV_IF(0 == addr16, ZIGBEE_ERROR_INVALID_ADDRESS);
29 RETV_IF(0 == ep, ZIGBEE_ERROR_INVALID_ENDPOINT);
31 ret = zbl_ccontrol_move_to_hue(addr16, ep, hue, direction, transition_time);
35 API int zb_zcl_ccontrol_move_hue(zb_zigbee_h handle, zb_nwk_addr addr16,
36 unsigned char ep, unsigned char move_mode, unsigned char rate)
38 int ret = ZIGBEE_ERROR_NONE;
39 CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
40 RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
41 RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
42 RETV_IF(0 == addr16, ZIGBEE_ERROR_INVALID_ADDRESS);
43 RETV_IF(0 == ep, ZIGBEE_ERROR_INVALID_ENDPOINT);
45 ret = zbl_ccontrol_move_hue(addr16, ep, move_mode, rate);
49 API int zb_zcl_ccontrol_step_hue(zb_zigbee_h handle, zb_nwk_addr addr16,
50 unsigned char ep, unsigned char step_mode, unsigned char step_size,
51 unsigned char transition_time)
53 int ret = ZIGBEE_ERROR_NONE;
54 CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
55 RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
56 RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
57 RETV_IF(0 == addr16, ZIGBEE_ERROR_INVALID_ADDRESS);
58 RETV_IF(0 == ep, ZIGBEE_ERROR_INVALID_ENDPOINT);
60 ret = zbl_ccontrol_step_hue(addr16, ep, step_mode, step_size, transition_time);
64 API int zb_zcl_ccontrol_move_to_saturation(zb_zigbee_h handle,
65 zb_nwk_addr addr16, unsigned char ep, unsigned char saturation,
66 unsigned short transition_time)
68 int ret = ZIGBEE_ERROR_NONE;
69 CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
70 RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
71 RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
72 RETV_IF(0 == addr16, ZIGBEE_ERROR_INVALID_ADDRESS);
73 RETV_IF(0 == ep, ZIGBEE_ERROR_INVALID_ENDPOINT);
75 ret = zbl_ccontrol_move_to_saturation(addr16, ep, saturation, transition_time);
79 API int zb_zcl_ccontrol_move_saturation(zb_zigbee_h handle, zb_nwk_addr addr16,
80 unsigned char ep, unsigned char move_mode, unsigned char rate)
82 int ret = ZIGBEE_ERROR_NONE;
83 CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
84 RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
85 RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
86 RETV_IF(0 == addr16, ZIGBEE_ERROR_INVALID_ADDRESS);
87 RETV_IF(0 == ep, ZIGBEE_ERROR_INVALID_ENDPOINT);
89 ret = zbl_ccontrol_move_saturation(addr16, ep, move_mode, rate);
93 API int zb_zcl_ccontrol_step_saturation(zb_zigbee_h handle, zb_nwk_addr addr16,
94 unsigned char ep, unsigned char step_mode, unsigned char step_size,
95 unsigned char transition_time)
97 int ret = ZIGBEE_ERROR_NONE;
98 CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
99 RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
100 RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
101 RETV_IF(0 == addr16, ZIGBEE_ERROR_INVALID_ADDRESS);
102 RETV_IF(0 == ep, ZIGBEE_ERROR_INVALID_ENDPOINT);
104 ret = zbl_ccontrol_step_saturation(addr16, ep, step_mode, step_size, transition_time);
108 API int zb_zcl_ccontrol_move_to_hue_and_saturation(zb_zigbee_h handle,
109 zb_nwk_addr addr16, unsigned char ep, unsigned char hue, unsigned char saturation,
110 unsigned short transition_time)
112 int ret = ZIGBEE_ERROR_NONE;
113 CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
114 RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
115 RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
116 RETV_IF(0 == addr16, ZIGBEE_ERROR_INVALID_ADDRESS);
117 RETV_IF(0 == ep, ZIGBEE_ERROR_INVALID_ENDPOINT);
119 ret = zbl_ccontrol_move_to_hue_and_saturation(addr16, ep, hue, saturation, transition_time);
123 API int zb_zcl_ccontrol_move_to_color(zb_zigbee_h handle, zb_nwk_addr addr16,
124 unsigned char ep, unsigned short color_x, unsigned short color_y,
125 unsigned short transition_time)
127 int ret = ZIGBEE_ERROR_NONE;
128 CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
129 RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
130 RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
131 RETV_IF(0 == addr16, ZIGBEE_ERROR_INVALID_ADDRESS);
132 RETV_IF(0 == ep, ZIGBEE_ERROR_INVALID_ENDPOINT);
134 ret = zbl_ccontrol_move_to_color(addr16, ep, color_x, color_y, transition_time);
138 API int zb_zcl_ccontrol_move_color(zb_zigbee_h handle, zb_nwk_addr addr16,
139 unsigned char ep, unsigned short rate_x, unsigned short rate_y)
141 int ret = ZIGBEE_ERROR_NONE;
142 CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
143 RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
144 RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
145 RETV_IF(0 == addr16, ZIGBEE_ERROR_INVALID_ADDRESS);
146 RETV_IF(0 == ep, ZIGBEE_ERROR_INVALID_ENDPOINT);
148 ret = zbl_ccontrol_move_color(addr16, ep, rate_x, rate_y);
152 API int zb_zcl_ccontrol_step_color(zb_zigbee_h handle, zb_nwk_addr addr16,
153 unsigned char ep, unsigned short step_x, unsigned short step_y,
154 unsigned short transition_time)
156 int ret = ZIGBEE_ERROR_NONE;
157 CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
158 RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
159 RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
160 RETV_IF(0 == addr16, ZIGBEE_ERROR_INVALID_ADDRESS);
161 RETV_IF(0 == ep, ZIGBEE_ERROR_INVALID_ENDPOINT);
163 ret = zbl_ccontrol_step_color(addr16, ep, step_x, step_y, transition_time);
167 API int zb_zcl_ccontrol_move_to_color_temperature(zb_zigbee_h handle,
168 zb_nwk_addr addr16, unsigned char ep, unsigned short color_temperature,
169 unsigned short transition_time)
171 int ret = ZIGBEE_ERROR_NONE;
172 CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
173 RETV_IF(NULL == handle, ZIGBEE_ERROR_INVALID_PARAMETER);
174 RETV_IF(NULL == zbl_dbus_get_object(), ZIGBEE_ERROR_IO_ERROR);
175 RETV_IF(0 == addr16, ZIGBEE_ERROR_INVALID_ADDRESS);
176 RETV_IF(0 == ep, ZIGBEE_ERROR_INVALID_ENDPOINT);
178 ret = zbl_ccontrol_move_to_color_temperature(addr16, ep, color_temperature, transition_time);