cb1c8c5efcac9a30cd792ab95555d09b769f7eca
[platform/core/connectivity/zigbee-manager.git] / zigbee-daemon / zigbee-interface / src / zigbee_service_dbus_interface_zclbasic_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_zclbasic_control_reset_factory_default(ZigbeeZclbasic_control *zclbasic_control_object,
22         GDBusMethodInvocation *invocation,
23         gshort node_id,
24         gchar dst_ep,
25         gpointer user_data)
26 {
27         ZigBeeService *service = (ZigBeeService *)user_data;
28
29         NOT_USED(zclbasic_control_object);
30         NOT_USED(invocation);
31         NOT_USED(service);
32         NOT_USED(node_id);
33         NOT_USED(dst_ep);
34
35         /*
36          * TODO -
37          * Create and send request for processing
38          */
39
40         return TRUE;
41 }
42
43 gboolean zigbee_service_dbus_interface_zclbasic_control_init(ZigBeeService *service,
44         ZigbeeObjectSkeleton *zigbee_object)
45 {
46         ZigbeeZclbasic_control *zclbasic_control_object;
47
48         if (NULL == service) {
49                 Z_LOGE("service is NULL");
50                 return FALSE;
51         }
52
53         zclbasic_control_object = zigbee_zclbasic_control_skeleton_new();
54         zigbee_object_skeleton_set_zclbasic_control(zigbee_object, zclbasic_control_object);
55         g_object_unref(zclbasic_control_object);
56
57         Z_LOGI("zclbasic_control_object: [%p]", zclbasic_control_object);
58
59         /*
60          * Register signal handlers for 'zclbasic_control' interface
61          */
62         g_signal_connect(zclbasic_control_object,
63                 "handle-reset-factory-default",
64                 G_CALLBACK(on_zclbasic_control_reset_factory_default), service);
65
66         return TRUE;
67 }