2 * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
4 * Contact: Suresh Kumar N (suresh.n@samsung.com)
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
19 #include "zigbee_service_interface_common.h"
21 static gboolean on_zcl_scene_add_scene(ZigbeeZcl_scene *zcl_scene_object,
22 GDBusMethodInvocation *invocation,
27 gshort transition_time,
30 GVariant *ext_field_set,
33 ZigBeeService *service = (ZigBeeService *)user_data;
35 NOT_USED(zcl_scene_object);
42 NOT_USED(transition_time);
45 NOT_USED(ext_field_set);
49 * Create and send request for processing
55 static gboolean on_zcl_scene_view_scene(ZigbeeZcl_scene *zcl_scene_object,
56 GDBusMethodInvocation *invocation,
63 ZigBeeService *service = (ZigBeeService *)user_data;
65 NOT_USED(zcl_scene_object);
75 * Create and send request for processing
81 static gboolean on_zcl_scene_remove_scene(ZigbeeZcl_scene *zcl_scene_object,
82 GDBusMethodInvocation *invocation,
89 ZigBeeService *service = (ZigBeeService *)user_data;
91 NOT_USED(zcl_scene_object);
101 * Create and send request for processing
107 static gboolean on_zcl_scene_store_scene(ZigbeeZcl_scene *zcl_scene_object,
108 GDBusMethodInvocation *invocation,
115 ZigBeeService *service = (ZigBeeService *)user_data;
117 NOT_USED(zcl_scene_object);
118 NOT_USED(invocation);
127 * Create and send request for processing
133 static gboolean on_zcl_scene_recall_scene(ZigbeeZcl_scene *zcl_scene_object,
134 GDBusMethodInvocation *invocation,
141 ZigBeeService *service = (ZigBeeService *)user_data;
143 NOT_USED(zcl_scene_object);
144 NOT_USED(invocation);
153 * Create and send request for processing
159 static gboolean on_zcl_scene_remove_all_scene(ZigbeeZcl_scene *zcl_scene_object,
160 GDBusMethodInvocation *invocation,
166 ZigBeeService *service = (ZigBeeService *)user_data;
168 NOT_USED(zcl_scene_object);
169 NOT_USED(invocation);
177 * Create and send request for processing
183 static gboolean on_zcl_scene_get_scene_membership(ZigbeeZcl_scene *zcl_scene_object,
184 GDBusMethodInvocation *invocation,
190 ZigBeeService *service = (ZigBeeService *)user_data;
192 NOT_USED(zcl_scene_object);
193 NOT_USED(invocation);
201 * Create and send request for processing
207 gboolean zigbee_service_dbus_interface_zcl_scene_init(ZigBeeService *service,
208 ZigbeeObjectSkeleton *zigbee_object)
210 ZigbeeZcl_scene *zcl_scene_object;
212 if (NULL == service) {
213 Z_LOGE("service is NULL");
217 zcl_scene_object = zigbee_zcl_scene_skeleton_new();
218 zigbee_object_skeleton_set_zcl_scene(zigbee_object, zcl_scene_object);
219 g_object_unref(zcl_scene_object);
221 Z_LOGI("zcl_scene_object: [%p]", zcl_scene_object);
224 * Register signal handlers for 'zcl_scene' interface
226 g_signal_connect(zcl_scene_object,
228 G_CALLBACK(on_zcl_scene_add_scene), service);
230 g_signal_connect(zcl_scene_object,
232 G_CALLBACK(on_zcl_scene_view_scene), service);
234 g_signal_connect(zcl_scene_object,
235 "handle-remove-scene",
236 G_CALLBACK(on_zcl_scene_remove_scene), service);
238 g_signal_connect(zcl_scene_object,
239 "handle-store-scene",
240 G_CALLBACK(on_zcl_scene_store_scene), service);
242 g_signal_connect(zcl_scene_object,
243 "handle-recall-scene",
244 G_CALLBACK(on_zcl_scene_recall_scene), service);
246 g_signal_connect(zcl_scene_object,
247 "handle-remove-all-scene",
248 G_CALLBACK(on_zcl_scene_remove_all_scene), service);
250 g_signal_connect(zcl_scene_object,
251 "handle-get-scene-membership",
252 G_CALLBACK(on_zcl_scene_get_scene_membership), service);