Adding service interface layer logic for request processing
[platform/core/connectivity/zigbee-manager.git] / zigbee-daemon / zigbee-interface / src / zigbee_service_dbus_interface_zclias_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_zclias_control_enroll_response(ZigbeeZclias_control *zclias_control_object,
22         GDBusMethodInvocation *invocation,
23         gshort node_id,
24         gchar dst_ep,
25         gchar enroll_code,
26         gchar zone_id,
27         gpointer user_data)
28 {
29         ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
30
31         NOT_USED(zclias_control_object);
32         NOT_USED(invocation);
33         NOT_USED(service_interface);
34         NOT_USED(node_id);
35         NOT_USED(dst_ep);
36         NOT_USED(enroll_code);
37         NOT_USED(zone_id);
38
39         /*
40          * TODO -
41          * Create and send request for processing
42          */
43
44         return TRUE;
45 }
46
47 gboolean zigbee_service_dbus_interface_zclias_control_init(ZigBeeServiceInterface *service_interface,
48         ZigbeeObjectSkeleton *zigbee_object)
49 {
50         ZigbeeZclias_control *zclias_control_object;
51
52         if (NULL == service_interface) {
53                 Z_LOGE("service_interface is NULL");
54                 return FALSE;
55         }
56
57         zclias_control_object = zigbee_zclias_control_skeleton_new();
58         zigbee_object_skeleton_set_zclias_control(zigbee_object, zclias_control_object);
59         g_object_unref(zclias_control_object);
60
61         Z_LOGI("zclias_control_object: [%p]", zclias_control_object);
62
63         /*
64          * Register signal handlers for 'zclias_control' interface
65          */
66         g_signal_connect(zclias_control_object,
67                 "handle-get-alarm-count",
68                 G_CALLBACK(on_zclias_control_enroll_response), service_interface);
69
70         return TRUE;
71 }