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_on_off_set_on_off(ZigbeeOn_off *on_off_object,
22 GDBusMethodInvocation *invocation,
28 ZigBeeService *service = (ZigBeeService *)user_data;
30 NOT_USED(on_off_object);
35 NOT_USED(on_off_type);
39 * Create and send request for processing
45 static gboolean on_on_off_get_on_off_state(ZigbeeOn_off *on_off_object,
46 GDBusMethodInvocation *invocation,
51 ZigBeeService *service = (ZigBeeService *)user_data;
53 NOT_USED(on_off_object);
61 * Create and send request for processing
67 gboolean zigbee_service_dbus_interface_on_off_init(ZigBeeService *service,
68 ZigbeeObjectSkeleton *zigbee_object)
70 ZigbeeOn_off *on_off_object;
72 if (NULL == service) {
73 Z_LOGE("service is NULL");
77 on_off_object = zigbee_on_off_skeleton_new();
78 zigbee_object_skeleton_set_on_off(zigbee_object, on_off_object);
79 g_object_unref(on_off_object);
81 Z_LOGI("on_off_object: [%p]", on_off_object);
84 * Register signal handlers for 'on_off' interface
86 g_signal_connect(on_off_object,
88 G_CALLBACK(on_on_off_set_on_off), service);
90 g_signal_connect(on_off_object,
91 "handle-get-on-off-state",
92 G_CALLBACK(on_on_off_get_on_off_state), service);