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_poll_control_check_in_response(ZigbeeZcl_poll_control *zcl_poll_control_object,
22 GDBusMethodInvocation *invocation,
25 gchar start_fast_polling,
26 gshort fast_poll_timeout,
29 ZigBeeService *service = (ZigBeeService *)user_data;
31 NOT_USED(zcl_poll_control_object);
36 NOT_USED(start_fast_polling);
37 NOT_USED(fast_poll_timeout);
41 * Create and send request for processing
47 static gboolean on_zcl_poll_control_fast_poll_stop(ZigbeeZcl_poll_control *zcl_poll_control_object,
48 GDBusMethodInvocation *invocation,
53 ZigBeeService *service = (ZigBeeService *)user_data;
55 NOT_USED(zcl_poll_control_object);
63 * Create and send request for processing
69 static gboolean on_zcl_poll_control_set_long_poll_interval(ZigbeeZcl_poll_control *zcl_poll_control_object,
70 GDBusMethodInvocation *invocation,
73 guint new_long_poll_interval,
76 ZigBeeService *service = (ZigBeeService *)user_data;
78 NOT_USED(zcl_poll_control_object);
83 NOT_USED(new_long_poll_interval);
87 * Create and send request for processing
93 static gboolean on_zcl_poll_control_set_short_poll_interval(ZigbeeZcl_poll_control *zcl_poll_control_object,
94 GDBusMethodInvocation *invocation,
97 guint new_short_poll_interval,
100 ZigBeeService *service = (ZigBeeService *)user_data;
102 NOT_USED(zcl_poll_control_object);
103 NOT_USED(invocation);
107 NOT_USED(new_short_poll_interval);
111 * Create and send request for processing
117 gboolean zigbee_service_dbus_interface_zcl_poll_control_init(ZigBeeService *service,
118 ZigbeeObjectSkeleton *zigbee_object)
120 ZigbeeZcl_poll_control *zcl_poll_control_object;
122 if (NULL == service) {
123 Z_LOGE("service is NULL");
127 zcl_poll_control_object = zigbee_zcl_poll_control_skeleton_new();
128 zigbee_object_skeleton_set_zcl_poll_control(zigbee_object, zcl_poll_control_object);
129 g_object_unref(zcl_poll_control_object);
131 Z_LOGI("zcl_poll_control_object: [%p]", zcl_poll_control_object);
134 * Register signal handlers for 'zcl_poll_control' interface
136 g_signal_connect(zcl_poll_control_object,
137 "handle-check-in-response",
138 G_CALLBACK(on_zcl_poll_control_check_in_response), service);
140 g_signal_connect(zcl_poll_control_object,
141 "handle-fast-poll-stop",
142 G_CALLBACK(on_zcl_poll_control_fast_poll_stop), service);
144 g_signal_connect(zcl_poll_control_object,
145 "handle-set-long-poll-interval",
146 G_CALLBACK(on_zcl_poll_control_set_long_poll_interval), service);
148 g_signal_connect(zcl_poll_control_object,
149 "handle-set-short-poll-interval",
150 G_CALLBACK(on_zcl_poll_control_set_short_poll_interval), service);