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_custom_aps_send(ZigbeeCustom *custom_object,
22 GDBusMethodInvocation *invocation,
34 ZigBeeService *service = (ZigBeeService *)user_data;
36 NOT_USED(custom_object);
40 NOT_USED(aps_frame_ctrl);
45 NOT_USED(zcl_frame_ctrl);
51 * Create and send request for processing
57 static gboolean on_custom_zcl_send(ZigbeeCustom *custom_object,
58 GDBusMethodInvocation *invocation,
68 ZigBeeService *service = (ZigBeeService *)user_data;
70 NOT_USED(custom_object);
77 NOT_USED(zcl_frame_ctrl);
83 * Create and send request for processing
89 static gboolean on_custom_send_to_local(ZigbeeCustom *custom_object,
90 GDBusMethodInvocation *invocation,
94 ZigBeeService *service = (ZigBeeService *)user_data;
96 NOT_USED(custom_object);
103 * Create and send request for processing
109 gboolean zigbee_service_dbus_interface_custom_init(ZigBeeService *service,
110 ZigbeeObjectSkeleton *zigbee_object)
112 ZigbeeCustom *custom_object;
114 if (NULL == service) {
115 Z_LOGE("service is NULL");
119 custom_object = zigbee_custom_skeleton_new();
120 zigbee_object_skeleton_set_custom(zigbee_object, custom_object);
121 g_object_unref(custom_object);
123 Z_LOGI("custom_object: [%p]", custom_object);
126 * Register signal handlers for 'custom' interface
128 g_signal_connect(custom_object,
130 G_CALLBACK(on_custom_aps_send), service);
132 g_signal_connect(custom_object,
134 G_CALLBACK(on_custom_zcl_send), service);
136 g_signal_connect(custom_object,
137 "handle-send-to-local",
138 G_CALLBACK(on_custom_send_to_local), service);