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_group_add_group(ZigbeeZcl_group *zcl_group_object,
22 GDBusMethodInvocation *invocation,
29 ZigBeeService *service = (ZigBeeService *)user_data;
31 NOT_USED(zcl_group_object);
41 * Create and send request for processing
47 static gboolean on_zcl_group_view_group(ZigbeeZcl_group *zcl_group_object,
48 GDBusMethodInvocation *invocation,
54 ZigBeeService *service = (ZigBeeService *)user_data;
56 NOT_USED(zcl_group_object);
65 * Create and send request for processing
71 static gboolean on_zcl_group_get_group_membership(ZigbeeZcl_group *zcl_group_object,
72 GDBusMethodInvocation *invocation,
79 ZigBeeService *service = (ZigBeeService *)user_data;
81 NOT_USED(zcl_group_object);
86 NOT_USED(group_count);
91 * Create and send request for processing
97 static gboolean on_zcl_group_remove_group(ZigbeeZcl_group *zcl_group_object,
98 GDBusMethodInvocation *invocation,
104 ZigBeeService *service = (ZigBeeService *)user_data;
106 NOT_USED(zcl_group_object);
107 NOT_USED(invocation);
115 * Create and send request for processing
121 static gboolean on_zcl_group_remove_all_group(ZigbeeZcl_group *zcl_group_object,
122 GDBusMethodInvocation *invocation,
127 ZigBeeService *service = (ZigBeeService *)user_data;
129 NOT_USED(zcl_group_object);
130 NOT_USED(invocation);
137 * Create and send request for processing
143 static gboolean on_zcl_group_add_group_if_identifying(ZigbeeZcl_group *zcl_group_object,
144 GDBusMethodInvocation *invocation,
148 GVariant *group_name,
151 ZigBeeService *service = (ZigBeeService *)user_data;
153 NOT_USED(zcl_group_object);
154 NOT_USED(invocation);
159 NOT_USED(group_name);
163 * Create and send request for processing
169 gboolean zigbee_service_dbus_interface_zcl_group_init(ZigBeeService *service,
170 ZigbeeObjectSkeleton *zigbee_object)
172 ZigbeeZcl_group *zcl_group_object;
174 if (NULL == service) {
175 Z_LOGE("service is NULL");
179 zcl_group_object = zigbee_zcl_group_skeleton_new();
180 zigbee_object_skeleton_set_zcl_group(zigbee_object, zcl_group_object);
181 g_object_unref(zcl_group_object);
183 Z_LOGI("zcl_group_object: [%p]", zcl_group_object);
186 * Register signal handlers for 'zcl_group' interface
188 g_signal_connect(zcl_group_object,
190 G_CALLBACK(on_zcl_group_add_group), service);
192 g_signal_connect(zcl_group_object,
194 G_CALLBACK(on_zcl_group_view_group), service);
196 g_signal_connect(zcl_group_object,
197 "handle-get-group-membership",
198 G_CALLBACK(on_zcl_group_get_group_membership), service);
200 g_signal_connect(zcl_group_object,
201 "handle-remove-group",
202 G_CALLBACK(on_zcl_group_remove_group), service);
204 g_signal_connect(zcl_group_object,
205 "handle-remove-all-group",
206 G_CALLBACK(on_zcl_group_remove_all_group), service);
208 g_signal_connect(zcl_group_object,
209 "handle-add-group-if-identifying",
210 G_CALLBACK(on_zcl_group_add_group_if_identifying), service);