5988c80673fb2aba5b2cabf42c47f6f68f422ccd
[platform/core/connectivity/zigbee-manager.git] / zigbee-daemon / zigbee-interface / src / zigbee_service_dbus_interface_zclidentify_control.c
1 /*
2  * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
3  *
4  * Contact: Suresh Kumar N (suresh.n@samsung.com)
5  *
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
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
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.
17  */
18
19 #include "zigbee_service_interface_common.h"
20
21 static gboolean on_zclidentify_control_identify(ZigbeeZclidentify_control *zclidentify_control_object,
22         GDBusMethodInvocation *invocation,
23         gshort node_id,
24         gchar dst_ep,
25         gshort identifytime,
26         gpointer user_data)
27 {
28         ZigBeeService *service = (ZigBeeService *)user_data;
29
30         NOT_USED(zclidentify_control_object);
31         NOT_USED(invocation);
32         NOT_USED(service);
33         NOT_USED(node_id);
34         NOT_USED(dst_ep);
35         NOT_USED(identifytime);
36
37         /*
38          * TODO -
39          * Create and send request for processing
40          */
41
42         return TRUE;
43 }
44
45 static gboolean on_zclidentify_control_query(ZigbeeZclidentify_control *zclidentify_control_object,
46         GDBusMethodInvocation *invocation,
47         gshort node_id,
48         gpointer user_data)
49 {
50         ZigBeeService *service = (ZigBeeService *)user_data;
51
52         NOT_USED(zclidentify_control_object);
53         NOT_USED(invocation);
54         NOT_USED(service);
55         NOT_USED(node_id);
56
57         /*
58          * TODO -
59          * Create and send request for processing
60          */
61
62         return TRUE;
63 }
64
65 gboolean zigbee_service_dbus_interface_zclidentify_control_init(ZigBeeService *service,
66         ZigbeeObjectSkeleton *zigbee_object)
67 {
68         ZigbeeZclidentify_control *zclidentify_control_object;
69
70         if (NULL == service) {
71                 Z_LOGE("service is NULL");
72                 return FALSE;
73         }
74
75         zclidentify_control_object = zigbee_zclidentify_control_skeleton_new();
76         zigbee_object_skeleton_set_zclidentify_control(zigbee_object, zclidentify_control_object);
77         g_object_unref(zclidentify_control_object);
78
79         Z_LOGI("zclidentify_control_object: [%p]", zclidentify_control_object);
80
81         /*
82          * Register signal handlers for 'zclidentify_control' interface
83          */
84         g_signal_connect(zclidentify_control_object,
85                 "handle-identify",
86                 G_CALLBACK(on_zclidentify_control_identify), service);
87
88         g_signal_connect(zclidentify_control_object,
89                 "handle-query",
90                 G_CALLBACK(on_zclidentify_control_query), service);
91
92         return TRUE;
93 }