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 #include <zblib_driver_service.h>
24 static void *_service_interface_ref_zigbee_service(ZigBeeServiceInterface *service_interface)
26 ZigbeeObjectSkeleton *zigbee_object = NULL;
27 ZigbeeCustomData_t *custom_data = NULL;
28 ZigbeeService *service = NULL;
30 custom_data = (ZigbeeCustomData_t *)zblib_service_interface_ref_user_data(service_interface);
31 if (NULL == custom_data) {
32 Z_LOGE("D-BUS service interface custom_data is NULL!");
36 /* Get zigbee object */
37 zigbee_object = g_hash_table_lookup(custom_data->objects, ZIGBEE_SERVICE_PATH);
38 if (NULL == zigbee_object) {
39 Z_LOGW("Cannot find ZigBee D-BUS interface object!", zigbee_object);
43 service = zigbee_object_get_service(ZIGBEE_OBJECT(zigbee_object));
47 static void on_service_zb_hw_reset_resp(ZigBeeServiceInterface *service_interface,
48 guint request_id, gpointer resp_data, guint resp_data_len, gpointer resp_cb_data)
50 ZigbeeServiceInterfaceRespCbData_t *cb_data =
51 (ZigbeeServiceInterfaceRespCbData_t *)resp_cb_data;
53 ZigbeeService *service_object;
54 GDBusMethodInvocation *invocation;
55 ZigbeeGeneralResp_t *payload = (ZigbeeGeneralResp_t*)resp_data;
57 NOT_USED(service_interface);
60 if (NULL == resp_data || 0 == resp_data_len) {
61 Z_LOGE("resp_data is null");
66 service_object = zigbee_service_dbus_interface_ref_interface_object(cb_data);
67 zblib_check_null_free_and_ret("service_object", service_object, cb_data);
69 invocation = zigbee_service_dbus_interface_ref_invocation(cb_data);
70 zblib_check_null_free_and_ret("invocation", invocation, cb_data);
72 zigbee_service_complete_zb_hw_reset(service_object, invocation, payload->result);
77 static gboolean on_service_zb_hw_reset(ZigbeeService *service_object,
78 GDBusMethodInvocation *invocation,
81 ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
82 ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
86 /* Allocate response callback data */
88 zigbee_service_dbus_interface_create_resp_cb_data(service_object,
90 if (NULL == resp_cb_data) {
91 Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
93 /* Send failure response */
94 ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
99 /* Dispatch request */
100 ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
101 ZBLIB_DRIVER_TYPE_SERVICE,
102 ZBLIB_SERVICE_OPS_ZB_HW_RESET,
104 on_service_zb_hw_reset_resp, resp_cb_data);
106 Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
108 /* Free response callback data */
109 zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
111 /* Send failure response */
112 ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
120 static void on_service_form_network_resp(ZigBeeServiceInterface *service_interface,
121 guint request_id, gpointer resp_data, guint resp_data_len, gpointer resp_cb_data)
123 ZigbeeServiceInterfaceRespCbData_t *cb_data =
124 (ZigbeeServiceInterfaceRespCbData_t *)resp_cb_data;
126 ZigbeeService *service_object;
127 GDBusMethodInvocation *invocation;
128 ZigbeeGeneralResp_t *payload = (ZigbeeGeneralResp_t*)resp_data;
130 NOT_USED(service_interface);
131 NOT_USED(request_id);
133 if (NULL == resp_data || 0 == resp_data_len) {
134 Z_LOGE("resp_data is null");
139 service_object = zigbee_service_dbus_interface_ref_interface_object(cb_data);
140 zblib_check_null_free_and_ret("service_object", service_object, cb_data);
142 invocation = zigbee_service_dbus_interface_ref_invocation(cb_data);
143 zblib_check_null_free_and_ret("invocation", invocation, cb_data);
145 zigbee_service_complete_form_network(service_object, invocation, payload->result);
150 static gboolean on_service_form_network(ZigbeeService *service_object,
151 GDBusMethodInvocation *invocation,
154 ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
155 ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
159 /* Allocate response callback data */
161 zigbee_service_dbus_interface_create_resp_cb_data(service_object,
162 invocation, NULL, 0);
163 if (NULL == resp_cb_data) {
164 Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
166 /* Send failure response */
167 ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
172 /* Dispatch request */
173 ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
174 ZBLIB_DRIVER_TYPE_SERVICE,
175 ZBLIB_SERVICE_OPS_FORM_NETWORK,
177 on_service_form_network_resp, resp_cb_data);
179 Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
181 /* Free response callback data */
182 zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
184 /* Send failure response */
185 ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
193 static void on_service_coex_start_resp(ZigBeeServiceInterface *service_interface,
194 guint request_id, gpointer resp_data, guint resp_data_len, gpointer resp_cb_data)
196 ZigbeeServiceInterfaceRespCbData_t *cb_data =
197 (ZigbeeServiceInterfaceRespCbData_t *)resp_cb_data;
199 ZigbeeService *service_object;
200 GDBusMethodInvocation *invocation;
201 ZigbeeGeneralResp_t *payload = (ZigbeeGeneralResp_t*)resp_data;
203 NOT_USED(service_interface);
204 NOT_USED(request_id);
206 if (NULL == resp_data || 0 == resp_data_len) {
207 Z_LOGE("resp_data is null");
212 service_object = zigbee_service_dbus_interface_ref_interface_object(cb_data);
213 zblib_check_null_free_and_ret("service_object", service_object, cb_data);
215 invocation = zigbee_service_dbus_interface_ref_invocation(cb_data);
216 zblib_check_null_free_and_ret("invocation", invocation, cb_data);
218 zigbee_service_complete_coex_start(service_object, invocation, payload->result);
223 static gboolean on_service_coex_start(ZigbeeService *service_object,
224 GDBusMethodInvocation *invocation,
228 ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
229 ZigbeeServiceCoexStart_t req;
230 ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
234 memset(&req, 0x0, sizeof(ZigbeeServiceCoexStart_t));
236 /* Update request structure */
237 req.channel = channel;
239 /* Allocate response callback data */
241 zigbee_service_dbus_interface_create_resp_cb_data(service_object,
242 invocation, NULL, 0);
243 if (NULL == resp_cb_data) {
244 Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
246 /* Send failure response */
247 ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
252 /* Dispatch request */
253 ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
254 ZBLIB_DRIVER_TYPE_SERVICE,
255 ZBLIB_SERVICE_OPS_COEX_START,
257 on_service_coex_start_resp, resp_cb_data);
259 Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
261 /* Free response callback data */
262 zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
264 /* Send failure response */
265 ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
273 static void on_service_coex_stop_resp(ZigBeeServiceInterface *service_interface,
274 guint request_id, gpointer resp_data, guint resp_data_len, gpointer resp_cb_data)
276 ZigbeeServiceInterfaceRespCbData_t *cb_data =
277 (ZigbeeServiceInterfaceRespCbData_t *)resp_cb_data;
279 ZigbeeService *service_object;
280 GDBusMethodInvocation *invocation;
281 ZigbeeGeneralResp_t *payload = (ZigbeeGeneralResp_t*)resp_data;
283 NOT_USED(service_interface);
284 NOT_USED(request_id);
286 if (NULL == resp_data || 0 == resp_data_len) {
287 Z_LOGE("resp_data is null");
292 service_object = zigbee_service_dbus_interface_ref_interface_object(cb_data);
293 zblib_check_null_free_and_ret("service_object", service_object, cb_data);
295 invocation = zigbee_service_dbus_interface_ref_invocation(cb_data);
296 zblib_check_null_free_and_ret("invocation", invocation, cb_data);
298 zigbee_service_complete_coex_stop(service_object, invocation, payload->result);
303 static gboolean on_service_coex_stop(ZigbeeService *service_object,
304 GDBusMethodInvocation *invocation,
307 ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
308 ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
312 /* Allocate response callback data */
314 zigbee_service_dbus_interface_create_resp_cb_data(service_object,
315 invocation, NULL, 0);
316 if (NULL == resp_cb_data) {
317 Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
319 /* Send failure response */
320 ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
325 /* Dispatch request */
326 ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
327 ZBLIB_DRIVER_TYPE_SERVICE,
328 ZBLIB_SERVICE_OPS_COEX_STOP,
330 on_service_coex_stop_resp, resp_cb_data);
332 Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
334 /* Free response callback data */
335 zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
337 /* Send failure response */
338 ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
346 static void on_service_leave_network_resp(ZigBeeServiceInterface *service_interface,
347 guint request_id, gpointer resp_data, guint resp_data_len, gpointer resp_cb_data)
349 ZigbeeServiceInterfaceRespCbData_t *cb_data =
350 (ZigbeeServiceInterfaceRespCbData_t *)resp_cb_data;
352 ZigbeeService *service_object;
353 GDBusMethodInvocation *invocation;
354 ZigbeeGeneralResp_t *payload = (ZigbeeGeneralResp_t*)resp_data;
356 NOT_USED(service_interface);
357 NOT_USED(request_id);
359 if (NULL == resp_data || 0 == resp_data_len) {
360 Z_LOGE("resp_data is null");
365 service_object = zigbee_service_dbus_interface_ref_interface_object(cb_data);
366 zblib_check_null_free_and_ret("service_object", service_object, cb_data);
368 invocation = zigbee_service_dbus_interface_ref_invocation(cb_data);
369 zblib_check_null_free_and_ret("invocation", invocation, cb_data);
371 zigbee_service_complete_leave_network(service_object, invocation, payload->result);
376 static gboolean on_service_leave_network(ZigbeeService *service_object,
377 GDBusMethodInvocation *invocation,
380 ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
381 ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
385 /* Allocate response callback data */
387 zigbee_service_dbus_interface_create_resp_cb_data(service_object,
388 invocation, NULL, 0);
389 if (NULL == resp_cb_data) {
390 Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
392 /* Send failure response */
393 ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
398 /* Dispatch request */
399 ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
400 ZBLIB_DRIVER_TYPE_SERVICE,
401 ZBLIB_SERVICE_OPS_LEAVE_NETWORK,
403 on_service_leave_network_resp, resp_cb_data);
405 Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
407 /* Free response callback data */
408 zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
410 /* Send failure response */
411 ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
419 static void on_service_get_network_info_resp(ZigBeeServiceInterface *service_interface,
420 guint request_id, gpointer resp_data, guint resp_data_len, gpointer resp_cb_data)
422 ZigbeeServiceInterfaceRespCbData_t *cb_data =
423 (ZigbeeServiceInterfaceRespCbData_t *)resp_cb_data;
425 ZigbeeService *service_object;
426 GDBusMethodInvocation *invocation;
428 ZigbeeServiceGetNetworkInfoResp_t *payload =
429 (ZigbeeServiceGetNetworkInfoResp_t*)resp_data;
431 GVariant *v_eui64 = NULL;
433 NOT_USED(service_interface);
434 NOT_USED(request_id);
436 if (NULL == resp_data || 0 == resp_data_len) {
437 Z_LOGE("resp_data is null");
442 service_object = zigbee_service_dbus_interface_ref_interface_object(cb_data);
443 zblib_check_null_free_and_ret("service_object", service_object, cb_data);
445 invocation = zigbee_service_dbus_interface_ref_invocation(cb_data);
446 zblib_check_null_free_and_ret("invocation", invocation, cb_data);
448 v_eui64 = g_variant_new_from_data(G_VARIANT_TYPE("a(y)"),
449 payload->eui64, ZIGBEE_EUI64_SIZE, TRUE, NULL, NULL);
451 zigbee_service_complete_get_network_info(service_object, invocation,
452 payload->result, v_eui64, payload->node_id,
453 payload->pan_id, payload->channel, payload->radio_tx_power);
456 g_variant_unref(v_eui64);
461 static gboolean on_service_get_network_info(ZigbeeService *service_object,
462 GDBusMethodInvocation *invocation,
465 ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
466 ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
470 /* Allocate response callback data */
472 zigbee_service_dbus_interface_create_resp_cb_data(service_object,
473 invocation, NULL, 0);
474 if (NULL == resp_cb_data) {
475 Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
477 /* Send failure response */
478 ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
483 /* Dispatch request */
484 ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
485 ZBLIB_DRIVER_TYPE_SERVICE,
486 ZBLIB_SERVICE_OPS_GET_NETWORK_INFO,
488 on_service_get_network_info_resp, resp_cb_data);
490 Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
492 /* Free response callback data */
493 zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
495 /* Send failure response */
496 ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
504 static void on_service_permit_join_resp(ZigBeeServiceInterface *service_interface,
505 guint request_id, gpointer resp_data, guint resp_data_len, gpointer resp_cb_data)
507 ZigbeeServiceInterfaceRespCbData_t *cb_data =
508 (ZigbeeServiceInterfaceRespCbData_t *)resp_cb_data;
510 ZigbeeService *service_object;
511 GDBusMethodInvocation *invocation;
512 ZigbeeGeneralResp_t *payload = (ZigbeeGeneralResp_t*)resp_data;
514 NOT_USED(service_interface);
515 NOT_USED(request_id);
517 if (NULL == resp_data || 0 == resp_data_len) {
518 Z_LOGE("resp_data is null");
523 service_object = zigbee_service_dbus_interface_ref_interface_object(cb_data);
524 zblib_check_null_free_and_ret("service_object", service_object, cb_data);
526 invocation = zigbee_service_dbus_interface_ref_invocation(cb_data);
527 zblib_check_null_free_and_ret("invocation", invocation, cb_data);
529 zigbee_service_complete_permit_join(service_object, invocation, payload->result);
534 static gboolean on_service_permit_join(ZigbeeService *service_object,
535 GDBusMethodInvocation *invocation,
537 gboolean permit_join,
540 ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
541 ZigbeeServicePermitJoin_t req;
542 ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
546 memset(&req, 0x0, sizeof(ZigbeeServicePermitJoin_t));
548 /* Update request structure */
549 req.duration = duration;
550 req.permit_join = permit_join;
552 /* Allocate response callback data */
554 zigbee_service_dbus_interface_create_resp_cb_data(service_object,
555 invocation, NULL, 0);
556 if (NULL == resp_cb_data) {
557 Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
559 /* Send failure response */
560 ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
565 /* Dispatch request */
566 ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
567 ZBLIB_DRIVER_TYPE_SERVICE,
568 ZBLIB_SERVICE_OPS_PERMIT_JOIN,
570 on_service_permit_join_resp, resp_cb_data);
572 Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
574 /* Free response callback data */
575 zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
577 /* Send failure response */
578 ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
586 static void on_service_leave_request_resp(ZigBeeServiceInterface *service_interface,
587 guint request_id, gpointer resp_data, guint resp_data_len, gpointer resp_cb_data)
589 ZigbeeServiceInterfaceRespCbData_t *cb_data =
590 (ZigbeeServiceInterfaceRespCbData_t *)resp_cb_data;
592 ZigbeeService *service_object;
593 GDBusMethodInvocation *invocation;
594 ZigbeeGeneralResp_t *payload = (ZigbeeGeneralResp_t*)resp_data;
596 NOT_USED(service_interface);
597 NOT_USED(request_id);
599 if (NULL == resp_data || 0 == resp_data_len) {
600 Z_LOGE("resp_data is null");
605 service_object = zigbee_service_dbus_interface_ref_interface_object(cb_data);
606 zblib_check_null_free_and_ret("service_object", service_object, cb_data);
608 invocation = zigbee_service_dbus_interface_ref_invocation(cb_data);
609 zblib_check_null_free_and_ret("invocation", invocation, cb_data);
611 zigbee_service_complete_leave_request(service_object, invocation, payload->result);
616 static gboolean on_service_leave_request(ZigbeeService *service_object,
617 GDBusMethodInvocation *invocation,
623 ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
624 ZigbeeServiceLeaveRequest_t req;
625 ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
627 GVariantIter *iter = NULL;
632 memset(&req, 0x0, sizeof(ZigbeeServiceLeaveRequest_t));
634 /* Update request structure */
635 g_variant_get(eui64, "a(y)", &iter);
636 while (g_variant_iter_loop(iter, "(y)", &(req.eui64[i]))) {
638 if (i >= ZIGBEE_EUI64_SIZE)
641 req.remove_child = remove_child;
644 Z_LOGD("IEEE Address = %X:%X:%X:%X:%X:%X:%X:%X",
645 req.eui64[0], req.eui64[1], req.eui64[2], req.eui64[3],
646 req.eui64[4], req.eui64[5], req.eui64[6], req.eui64[7]);
647 Z_LOGD("remove_child [%d]", remove_child);
648 Z_LOGD("rejoin [%d]", rejoin);
650 /* Allocate response callback data */
652 zigbee_service_dbus_interface_create_resp_cb_data(service_object,
653 invocation, NULL, 0);
654 if (NULL == resp_cb_data) {
655 Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
657 /* Send failure response */
658 ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
663 /* Dispatch request */
664 ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
665 ZBLIB_DRIVER_TYPE_SERVICE,
666 ZBLIB_SERVICE_OPS_LEAVE_REQUEST,
668 on_service_leave_request_resp, resp_cb_data);
670 Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
672 /* Free response callback data */
673 zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
675 /* Send failure response */
676 ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
684 static void on_service_get_device_list_resp(ZigBeeServiceInterface *service_interface,
685 guint request_id, gpointer resp_data, guint resp_data_len, gpointer resp_cb_data)
687 ZigbeeServiceInterfaceRespCbData_t *cb_data =
688 (ZigbeeServiceInterfaceRespCbData_t *)resp_cb_data;
690 ZigbeeService *service_object;
691 GDBusMethodInvocation *invocation;
693 NOT_USED(service_interface);
694 NOT_USED(request_id);
696 if (NULL == resp_data || 0 == resp_data_len) {
697 Z_LOGE("resp_data is null");
702 service_object = zigbee_service_dbus_interface_ref_interface_object(cb_data);
703 zblib_check_null_free_and_ret("service_object", service_object, cb_data);
705 invocation = zigbee_service_dbus_interface_ref_invocation(cb_data);
706 zblib_check_null_free_and_ret("invocation", invocation, cb_data);
708 /* TODO : zigbee_service_complete_get_device_list */
709 /* zigbee_service_complete_get_device_list(service_object, invocation, resp_data); */
714 static gboolean on_service_get_device_list(ZigbeeService *service_object,
715 GDBusMethodInvocation *invocation,
718 ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
719 ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
723 /* Allocate response callback data */
725 zigbee_service_dbus_interface_create_resp_cb_data(service_object,
726 invocation, NULL, 0);
727 if (NULL == resp_cb_data) {
728 Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
730 /* Send failure response */
731 ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
736 /* Dispatch request */
737 ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
738 ZBLIB_DRIVER_TYPE_SERVICE,
739 ZBLIB_SERVICE_OPS_GET_DEVICE_LIST,
741 on_service_get_device_list_resp, resp_cb_data);
743 Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
745 /* Free response callback data */
746 zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
748 /* Send failure response */
749 ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
757 static void on_service_get_mac_resp(ZigBeeServiceInterface *service_interface,
758 guint request_id, gpointer resp_data, guint resp_data_len, gpointer resp_cb_data)
760 ZigbeeServiceInterfaceRespCbData_t *cb_data =
761 (ZigbeeServiceInterfaceRespCbData_t *)resp_cb_data;
763 ZigbeeService *service_object;
764 GDBusMethodInvocation *invocation;
765 ZigbeeServiceGetMacResp_t *payload =
766 (ZigbeeServiceGetMacResp_t*)resp_data;
768 GVariant *v_eui64 = NULL;
770 NOT_USED(service_interface);
771 NOT_USED(request_id);
773 if (NULL == resp_data || 0 == resp_data_len) {
774 Z_LOGE("resp_data is null");
779 service_object = zigbee_service_dbus_interface_ref_interface_object(cb_data);
780 zblib_check_null_free_and_ret("service_object", service_object, cb_data);
782 invocation = zigbee_service_dbus_interface_ref_invocation(cb_data);
783 zblib_check_null_free_and_ret("invocation", invocation, cb_data);
785 v_eui64 = g_variant_new_from_data(G_VARIANT_TYPE("a(y)"),
786 payload->eui64, ZIGBEE_EUI64_SIZE, TRUE, NULL, NULL);
788 zigbee_service_complete_get_mac(service_object, invocation, payload->result,
792 g_variant_unref(v_eui64);
797 static gboolean on_service_get_mac(ZigbeeService *service_object,
798 GDBusMethodInvocation *invocation,
801 ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
802 ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
806 /* Allocate response callback data */
808 zigbee_service_dbus_interface_create_resp_cb_data(service_object,
809 invocation, NULL, 0);
810 if (NULL == resp_cb_data) {
811 Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
813 /* Send failure response */
814 ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
819 /* Dispatch request */
820 ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
821 ZBLIB_DRIVER_TYPE_SERVICE,
822 ZBLIB_SERVICE_OPS_GET_MAC,
824 on_service_get_mac_resp, resp_cb_data);
826 Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
828 /* Free response callback data */
829 zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
831 /* Send failure response */
832 ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
840 static void on_service_get_device_info_resp(ZigBeeServiceInterface *service_interface,
841 guint request_id, gpointer resp_data, guint resp_data_len, gpointer resp_cb_data)
843 ZigbeeServiceInterfaceRespCbData_t *cb_data =
844 (ZigbeeServiceInterfaceRespCbData_t *)resp_cb_data;
846 ZigbeeService *service_object;
847 GDBusMethodInvocation *invocation;
848 ZigbeeServiceGetDeviceInfoResp_t *payload =
849 (ZigbeeServiceGetDeviceInfoResp_t*)resp_data;
851 GVariant *variant = NULL;
852 GVariantBuilder* builder = NULL;
856 NOT_USED(service_interface);
857 NOT_USED(request_id);
859 if (NULL == resp_data || 0 == resp_data_len) {
860 Z_LOGE("resp_data is null");
865 service_object = zigbee_service_dbus_interface_ref_interface_object(cb_data);
866 zblib_check_null_free_and_ret("service_object", service_object, cb_data);
868 invocation = zigbee_service_dbus_interface_ref_invocation(cb_data);
869 zblib_check_null_free_and_ret("invocation", invocation, cb_data);
871 builder = g_variant_builder_new(G_VARIANT_TYPE("a(qyayyay)"));
872 for (index = 0; index < payload->count; index++) {
873 ZigbeeServiceGetDeviceInfoDetailResp_t *device = &(payload->list[index]);
874 GVariantBuilder* mac_builder = g_variant_builder_new(G_VARIANT_TYPE("ay"));
875 GVariantBuilder* endpoint_builder = g_variant_builder_new(G_VARIANT_TYPE("ay"));
877 for (i = 0; i < ZIGBEE_EUI64_SIZE; i++)
878 g_variant_builder_add(mac_builder, "y", device->eui64[i]);
879 for (i = 0; i < device->endpoint_count; i++)
880 g_variant_builder_add(endpoint_builder, "y", device->endpoints[i]);
882 g_variant_builder_add(builder, "(qyayyay)",
883 device->node_id, device->node_type,
884 mac_builder, device->endpoint_count, endpoint_builder);
886 g_variant_builder_unref(mac_builder);
887 g_variant_builder_unref(endpoint_builder);
890 variant = g_variant_builder_end(builder);
891 zigbee_service_complete_get_device_info(service_object, invocation,
892 payload->result, variant);
895 g_variant_unref(variant);
900 static gboolean on_service_get_device_info(ZigbeeService *service_object,
901 GDBusMethodInvocation *invocation,
904 ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
905 ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
909 /* Allocate response callback data */
911 zigbee_service_dbus_interface_create_resp_cb_data(service_object,
912 invocation, NULL, 0);
913 if (NULL == resp_cb_data) {
914 Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
916 /* Send failure response */
917 ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
922 /* Dispatch request */
923 ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
924 ZBLIB_DRIVER_TYPE_SERVICE,
925 ZBLIB_SERVICE_OPS_GET_DEVICE_INFO,
927 on_service_get_device_info_resp, resp_cb_data);
929 Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
931 /* Free response callback data */
932 zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
934 /* Send failure response */
935 ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
943 static void on_service_get_endpoint_list_resp(ZigBeeServiceInterface *service_interface,
944 guint request_id, gpointer resp_data, guint resp_data_len, gpointer resp_cb_data)
946 ZigbeeServiceInterfaceRespCbData_t *cb_data =
947 (ZigbeeServiceInterfaceRespCbData_t *)resp_cb_data;
949 ZigbeeService *service_object;
950 GDBusMethodInvocation *invocation;
951 ZigbeeServiceGetEndpointListResp_t *payload =
952 (ZigbeeServiceGetEndpointListResp_t*)resp_data;
953 GVariant *v_endpoints = NULL;
955 NOT_USED(service_interface);
956 NOT_USED(request_id);
958 if (NULL == resp_data || 0 == resp_data_len) {
959 Z_LOGE("resp_data is null");
964 service_object = zigbee_service_dbus_interface_ref_interface_object(cb_data);
965 zblib_check_null_free_and_ret("service_object", service_object, cb_data);
967 invocation = zigbee_service_dbus_interface_ref_invocation(cb_data);
968 zblib_check_null_free_and_ret("invocation", invocation, cb_data);
970 v_endpoints = g_variant_new_from_data(G_VARIANT_TYPE("a(y)"),
971 payload->endpoints, payload->endpoint_count, TRUE, NULL, NULL);
973 zigbee_service_complete_get_endpoint_list(service_object, invocation,
974 payload->result, v_endpoints);
977 g_variant_unref(v_endpoints);
982 static gboolean on_service_get_endpoint_list(ZigbeeService *service_object,
983 GDBusMethodInvocation *invocation,
987 ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
988 ZigbeeServiceGetEndpointList_t req;
989 ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
991 GVariantIter *iter = NULL;
996 memset(&req, 0x0, sizeof(ZigbeeServiceGetEndpointList_t));
998 /* Update request structure */
999 g_variant_get(eui64, "a(y)", &iter);
1000 while (g_variant_iter_loop(iter, "(y)", &(req.eui64[i]))) {
1002 if (i >= ZIGBEE_EUI64_SIZE)
1006 /* Allocate response callback data */
1008 zigbee_service_dbus_interface_create_resp_cb_data(service_object,
1009 invocation, NULL, 0);
1010 if (NULL == resp_cb_data) {
1011 Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
1013 /* Send failure response */
1014 ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
1019 /* Dispatch request */
1020 ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
1021 ZBLIB_DRIVER_TYPE_SERVICE,
1022 ZBLIB_SERVICE_OPS_GET_ENDPOINT_LIST,
1024 on_service_get_endpoint_list_resp, resp_cb_data);
1026 Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
1028 /* Free response callback data */
1029 zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
1031 /* Send failure response */
1032 ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
1040 static void on_service_get_cluster_list_resp(ZigBeeServiceInterface *service_interface,
1041 guint request_id, gpointer resp_data, guint resp_data_len, gpointer resp_cb_data)
1043 ZigbeeServiceInterfaceRespCbData_t *cb_data =
1044 (ZigbeeServiceInterfaceRespCbData_t *)resp_cb_data;
1046 ZigbeeService *service_object;
1047 GDBusMethodInvocation *invocation;
1048 ZigbeeServiceGetClusterListResp_t *payload =
1049 (ZigbeeServiceGetClusterListResp_t*)resp_data;
1050 GVariant *v_in_clusters = NULL;
1051 GVariant *v_out_clusters = NULL;
1053 NOT_USED(service_interface);
1054 NOT_USED(request_id);
1056 if (NULL == resp_data || 0 == resp_data_len) {
1057 Z_LOGE("resp_data is null");
1062 service_object = zigbee_service_dbus_interface_ref_interface_object(cb_data);
1063 zblib_check_null_free_and_ret("service_object", service_object, cb_data);
1065 invocation = zigbee_service_dbus_interface_ref_invocation(cb_data);
1066 zblib_check_null_free_and_ret("invocation", invocation, cb_data);
1068 v_in_clusters = g_variant_new_from_data(G_VARIANT_TYPE("aq"),
1069 payload->in_clusters, (payload->in_cluster_count * sizeof(unsigned short)),
1071 v_out_clusters = g_variant_new_from_data(G_VARIANT_TYPE("aq"),
1072 payload->out_clusters, (payload->out_cluster_count * sizeof(unsigned short)),
1075 zigbee_service_complete_get_cluster_list(service_object, invocation,
1076 payload->result, v_in_clusters, v_out_clusters);
1079 g_variant_unref(v_in_clusters);
1081 g_variant_unref(v_out_clusters);
1086 static gboolean on_service_get_cluster_list(ZigbeeService *service_object,
1087 GDBusMethodInvocation *invocation,
1092 ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
1093 ZigbeeServiceGetClusterList_t req;
1094 ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
1096 GVariantIter *iter = NULL;
1101 memset(&req, 0x0, sizeof(ZigbeeServiceGetClusterList_t));
1103 /* Update request structure */
1104 g_variant_get(eui64, "a(y)", &iter);
1105 while (g_variant_iter_loop(iter, "(y)", &(req.eui64[i]))) {
1107 if (i >= ZIGBEE_EUI64_SIZE)
1110 req.endpoint = endpoint;
1112 /* Allocate response callback data */
1114 zigbee_service_dbus_interface_create_resp_cb_data(service_object,
1115 invocation, NULL, 0);
1116 if (NULL == resp_cb_data) {
1117 Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
1119 /* Send failure response */
1120 ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
1125 /* Dispatch request */
1126 ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
1127 ZBLIB_DRIVER_TYPE_SERVICE,
1128 ZBLIB_SERVICE_OPS_GET_CLUSTER_LIST,
1130 on_service_get_cluster_list_resp, resp_cb_data);
1132 Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
1134 /* Free response callback data */
1135 zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
1137 /* Send failure response */
1138 ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
1146 static void on_service_get_node_type_resp(ZigBeeServiceInterface *service_interface,
1147 guint request_id, gpointer resp_data, guint resp_data_len, gpointer resp_cb_data)
1149 ZigbeeServiceInterfaceRespCbData_t *cb_data =
1150 (ZigbeeServiceInterfaceRespCbData_t *)resp_cb_data;
1152 ZigbeeService *service_object;
1153 GDBusMethodInvocation *invocation;
1154 ZigbeeServiceServiceNodeTypeResp_t *payload =
1155 (ZigbeeServiceServiceNodeTypeResp_t *)resp_data;
1157 NOT_USED(service_interface);
1158 NOT_USED(request_id);
1160 if (NULL == resp_data || 0 == resp_data_len) {
1161 Z_LOGE("resp_data is null");
1166 service_object = zigbee_service_dbus_interface_ref_interface_object(cb_data);
1167 zblib_check_null_free_and_ret("service_object", service_object, cb_data);
1169 invocation = zigbee_service_dbus_interface_ref_invocation(cb_data);
1170 zblib_check_null_free_and_ret("invocation", invocation, cb_data);
1172 zigbee_service_complete_get_node_type(service_object, invocation,
1173 payload->result, payload->node_type);
1178 static gboolean on_service_get_node_type(ZigbeeService *service_object,
1179 GDBusMethodInvocation *invocation,
1183 ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
1184 ZigbeeServiceGetNodeType_t req;
1185 ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
1187 GVariantIter *iter = NULL;
1192 memset(&req, 0x0, sizeof(ZigbeeServiceGetNodeType_t));
1194 /* Update request structure */
1195 g_variant_get(eui64, "a(y)", &iter);
1196 while (g_variant_iter_loop(iter, "(y)", req.eui64[i])) {
1198 if (i >= ZIGBEE_EUI64_SIZE)
1202 /* Allocate response callback data */
1204 zigbee_service_dbus_interface_create_resp_cb_data(service_object,
1205 invocation, NULL, 0);
1206 if (NULL == resp_cb_data) {
1207 Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
1209 /* Send failure response */
1210 ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
1215 /* Dispatch request */
1216 ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
1217 ZBLIB_DRIVER_TYPE_SERVICE,
1218 ZBLIB_SERVICE_OPS_GET_NODE_TYPE,
1220 on_service_get_node_type_resp, resp_cb_data);
1222 Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
1224 /* Free response callback data */
1225 zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
1227 /* Send failure response */
1228 ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
1236 static gboolean on_service_check_privilege(ZigbeeService *service_object,
1237 GDBusMethodInvocation *invocation,
1240 NOT_USED(user_data);
1242 zigbee_service_complete_check_privilege(service_object, invocation);
1247 void zigbee_service_dbus_interface_service_notification(ZigBeeServiceInterface *service_interface,
1248 guint noti_id, gpointer noti_data, guint noti_data_len, gpointer noti_cb_data)
1250 ZigbeeService *service_object;
1252 zblib_check_null_ret("service_interface", service_interface);
1254 if (NULL == noti_data || 0 == noti_data_len) {
1255 Z_LOGE("noti_data is NULL");
1259 service_object = _service_interface_ref_zigbee_service(service_interface);
1260 zblib_check_null_ret("service_object", service_object);
1262 NOT_USED(noti_cb_data);
1265 case ZBLIB_SERVICE_NOTI_FORM_NETWORK_DONE: {
1266 ZigbeeServiceServiceFormNetworkDone_t *panid_t =
1267 (ZigbeeServiceServiceFormNetworkDone_t*)noti_data;
1269 Z_LOGD("form_network_done : [0x%X]", panid_t->pan_id);
1271 zigbee_service_emit_form_network_done(service_object, panid_t->pan_id);
1274 case ZBLIB_SERVICE_NOTI_CHILD_JOINED: {
1275 ZigbeeServiceServiceChildJoined_t *child_t =
1276 (ZigbeeServiceServiceChildJoined_t*)noti_data;
1278 GVariant *v_eui64 = NULL;
1279 GVariant *v_endpoints = NULL;
1281 v_eui64 = g_variant_new_from_data(G_VARIANT_TYPE("a(y)"),
1282 child_t->eui64, ZIGBEE_EUI64_SIZE, TRUE, NULL, NULL);
1283 v_endpoints = g_variant_new_from_data(G_VARIANT_TYPE("a(y)"),
1284 child_t->endpoints, child_t->endpoint_count, TRUE, NULL, NULL);
1285 if (NULL == v_eui64 || NULL == v_endpoints) {
1286 Z_LOGE("Failed to create variant!");
1288 zigbee_service_emit_child_joined(service_object,
1289 v_eui64, child_t->endpoint_count, v_endpoints, child_t->node_id);
1292 g_variant_unref(v_eui64);
1294 g_variant_unref(v_endpoints);
1297 case ZBLIB_SERVICE_NOTI_CHILD_REJOINED: {
1298 ZigbeeServiceServiceChildRejoined_t *child_t =
1299 (ZigbeeServiceServiceChildRejoined_t*)noti_data;
1301 GVariant *v_eui64 = g_variant_new_from_data(G_VARIANT_TYPE("a(y)"),
1302 child_t->eui64, ZIGBEE_EUI64_SIZE, TRUE, NULL, NULL);
1303 if (NULL == v_eui64)
1304 Z_LOGE("Failed to create variant!");
1306 zigbee_service_emit_child_rejoined(service_object, v_eui64);
1308 g_variant_unref(v_eui64);
1311 case ZBLIB_SERVICE_NOTI_CHILD_LEFT: {
1312 ZigbeeServiceServiceChildLeft_t *child_left_t =
1313 (ZigbeeServiceServiceChildLeft_t*)noti_data;
1315 GVariant *v_eui64 = g_variant_new_from_data(G_VARIANT_TYPE("a(y)"),
1316 child_left_t->eui64, ZIGBEE_EUI64_SIZE, TRUE, NULL, NULL);
1317 if (NULL == v_eui64)
1318 Z_LOGE("Failed to create variant!");
1320 zigbee_service_emit_child_left(service_object,
1321 v_eui64, child_left_t->status);
1322 g_variant_unref(v_eui64);
1326 case ZBLIB_SERVICE_NOTI_LEAVE_NETWORK_DONE: {
1327 ZigbeeServiceServiceLeaveNetworkDone_t leave_net_t;
1328 memcpy(&leave_net_t, noti_data, noti_data_len);
1329 zigbee_service_emit_leave_network_done(service_object, leave_net_t.pan_id);
1333 Z_LOGE("Unexpected notification [%x]", noti_id);
1337 /* ZigbeeService should be dereferenced */
1338 g_object_unref(service_object);
1340 /* LCOV_EXCL_STOP */
1342 gboolean zigbee_service_dbus_interface_service_init(ZigBeeServiceInterface *service_interface,
1343 ZigbeeObjectSkeleton *zigbee_object)
1345 ZigbeeService *service_object;
1347 if (NULL == service_interface) {
1348 /* LCOV_EXCL_START */
1349 Z_LOGE("service_interface is NULL");
1351 /* LCOV_EXCL_STOP */
1354 service_object = zigbee_service_skeleton_new();
1355 zigbee_object_skeleton_set_service(zigbee_object, service_object);
1356 g_object_unref(service_object);
1358 Z_LOGI("service_object: [%p]", service_object);
1361 * Register signal handlers for 'service' interface
1363 g_signal_connect(service_object,
1364 "handle-zb-hw-reset",
1365 G_CALLBACK(on_service_zb_hw_reset), service_interface);
1367 g_signal_connect(service_object,
1368 "handle-form-network",
1369 G_CALLBACK(on_service_form_network), service_interface);
1371 g_signal_connect(service_object,
1372 "handle-coex-start",
1373 G_CALLBACK(on_service_coex_start), service_interface);
1375 g_signal_connect(service_object,
1377 G_CALLBACK(on_service_coex_stop), service_interface);
1379 g_signal_connect(service_object,
1380 "handle-leave-network",
1381 G_CALLBACK(on_service_leave_network), service_interface);
1383 g_signal_connect(service_object,
1384 "handle-get-network-info",
1385 G_CALLBACK(on_service_get_network_info), service_interface);
1387 g_signal_connect(service_object,
1388 "handle-permit-join",
1389 G_CALLBACK(on_service_permit_join), service_interface);
1391 g_signal_connect(service_object,
1392 "handle-leave-request",
1393 G_CALLBACK(on_service_leave_request), service_interface);
1395 g_signal_connect(service_object,
1396 "handle-get-device-list",
1397 G_CALLBACK(on_service_get_device_list), service_interface);
1399 g_signal_connect(service_object,
1401 G_CALLBACK(on_service_get_mac), service_interface);
1403 g_signal_connect(service_object,
1404 "handle-get-device-info",
1405 G_CALLBACK(on_service_get_device_info), service_interface);
1407 g_signal_connect(service_object,
1408 "handle-get-endpoint-list",
1409 G_CALLBACK(on_service_get_endpoint_list), service_interface);
1411 g_signal_connect(service_object,
1412 "handle-get-cluster-list",
1413 G_CALLBACK(on_service_get_cluster_list), service_interface);
1415 g_signal_connect(service_object,
1416 "handle-get-node-type",
1417 G_CALLBACK(on_service_get_node_type), service_interface);
1419 g_signal_connect(service_object,
1420 "handle-check-privilege",
1421 G_CALLBACK(on_service_check_privilege), service_interface);