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);
897 g_variant_builder_unref(builder);
902 static gboolean on_service_get_device_info(ZigbeeService *service_object,
903 GDBusMethodInvocation *invocation,
906 ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
907 ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
911 /* Allocate response callback data */
913 zigbee_service_dbus_interface_create_resp_cb_data(service_object,
914 invocation, NULL, 0);
915 if (NULL == resp_cb_data) {
916 Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
918 /* Send failure response */
919 ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
924 /* Dispatch request */
925 ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
926 ZBLIB_DRIVER_TYPE_SERVICE,
927 ZBLIB_SERVICE_OPS_GET_DEVICE_INFO,
929 on_service_get_device_info_resp, resp_cb_data);
931 Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
933 /* Free response callback data */
934 zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
936 /* Send failure response */
937 ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
945 static void on_service_get_endpoint_list_resp(ZigBeeServiceInterface *service_interface,
946 guint request_id, gpointer resp_data, guint resp_data_len, gpointer resp_cb_data)
948 ZigbeeServiceInterfaceRespCbData_t *cb_data =
949 (ZigbeeServiceInterfaceRespCbData_t *)resp_cb_data;
951 ZigbeeService *service_object;
952 GDBusMethodInvocation *invocation;
953 ZigbeeServiceGetEndpointListResp_t *payload =
954 (ZigbeeServiceGetEndpointListResp_t*)resp_data;
955 GVariant *v_endpoints = NULL;
957 NOT_USED(service_interface);
958 NOT_USED(request_id);
960 if (NULL == resp_data || 0 == resp_data_len) {
961 Z_LOGE("resp_data is null");
966 service_object = zigbee_service_dbus_interface_ref_interface_object(cb_data);
967 zblib_check_null_free_and_ret("service_object", service_object, cb_data);
969 invocation = zigbee_service_dbus_interface_ref_invocation(cb_data);
970 zblib_check_null_free_and_ret("invocation", invocation, cb_data);
972 v_endpoints = g_variant_new_from_data(G_VARIANT_TYPE("a(y)"),
973 payload->endpoints, payload->endpoint_count, TRUE, NULL, NULL);
975 zigbee_service_complete_get_endpoint_list(service_object, invocation,
976 payload->result, v_endpoints);
979 g_variant_unref(v_endpoints);
984 static gboolean on_service_get_endpoint_list(ZigbeeService *service_object,
985 GDBusMethodInvocation *invocation,
989 ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
990 ZigbeeServiceGetEndpointList_t req;
991 ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
993 GVariantIter *iter = NULL;
998 memset(&req, 0x0, sizeof(ZigbeeServiceGetEndpointList_t));
1000 /* Update request structure */
1001 g_variant_get(eui64, "a(y)", &iter);
1002 while (g_variant_iter_loop(iter, "(y)", &(req.eui64[i]))) {
1004 if (i >= ZIGBEE_EUI64_SIZE)
1008 /* Allocate response callback data */
1010 zigbee_service_dbus_interface_create_resp_cb_data(service_object,
1011 invocation, NULL, 0);
1012 if (NULL == resp_cb_data) {
1013 Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
1015 /* Send failure response */
1016 ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
1021 /* Dispatch request */
1022 ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
1023 ZBLIB_DRIVER_TYPE_SERVICE,
1024 ZBLIB_SERVICE_OPS_GET_ENDPOINT_LIST,
1026 on_service_get_endpoint_list_resp, resp_cb_data);
1028 Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
1030 /* Free response callback data */
1031 zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
1033 /* Send failure response */
1034 ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
1042 static void on_service_get_cluster_list_resp(ZigBeeServiceInterface *service_interface,
1043 guint request_id, gpointer resp_data, guint resp_data_len, gpointer resp_cb_data)
1045 ZigbeeServiceInterfaceRespCbData_t *cb_data =
1046 (ZigbeeServiceInterfaceRespCbData_t *)resp_cb_data;
1048 ZigbeeService *service_object;
1049 GDBusMethodInvocation *invocation;
1050 ZigbeeServiceGetClusterListResp_t *payload =
1051 (ZigbeeServiceGetClusterListResp_t*)resp_data;
1052 GVariant *v_in_clusters = NULL;
1053 GVariant *v_out_clusters = NULL;
1055 NOT_USED(service_interface);
1056 NOT_USED(request_id);
1058 if (NULL == resp_data || 0 == resp_data_len) {
1059 Z_LOGE("resp_data is null");
1064 service_object = zigbee_service_dbus_interface_ref_interface_object(cb_data);
1065 zblib_check_null_free_and_ret("service_object", service_object, cb_data);
1067 invocation = zigbee_service_dbus_interface_ref_invocation(cb_data);
1068 zblib_check_null_free_and_ret("invocation", invocation, cb_data);
1070 v_in_clusters = g_variant_new_from_data(G_VARIANT_TYPE("aq"),
1071 payload->in_clusters, (payload->in_cluster_count * sizeof(unsigned short)),
1073 v_out_clusters = g_variant_new_from_data(G_VARIANT_TYPE("aq"),
1074 payload->out_clusters, (payload->out_cluster_count * sizeof(unsigned short)),
1077 zigbee_service_complete_get_cluster_list(service_object, invocation,
1078 payload->result, v_in_clusters, v_out_clusters);
1081 g_variant_unref(v_in_clusters);
1083 g_variant_unref(v_out_clusters);
1088 static gboolean on_service_get_cluster_list(ZigbeeService *service_object,
1089 GDBusMethodInvocation *invocation,
1094 ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
1095 ZigbeeServiceGetClusterList_t req;
1096 ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
1098 GVariantIter *iter = NULL;
1103 memset(&req, 0x0, sizeof(ZigbeeServiceGetClusterList_t));
1105 /* Update request structure */
1106 g_variant_get(eui64, "a(y)", &iter);
1107 while (g_variant_iter_loop(iter, "(y)", &(req.eui64[i]))) {
1109 if (i >= ZIGBEE_EUI64_SIZE)
1112 req.endpoint = endpoint;
1114 /* Allocate response callback data */
1116 zigbee_service_dbus_interface_create_resp_cb_data(service_object,
1117 invocation, NULL, 0);
1118 if (NULL == resp_cb_data) {
1119 Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
1121 /* Send failure response */
1122 ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
1127 /* Dispatch request */
1128 ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
1129 ZBLIB_DRIVER_TYPE_SERVICE,
1130 ZBLIB_SERVICE_OPS_GET_CLUSTER_LIST,
1132 on_service_get_cluster_list_resp, resp_cb_data);
1134 Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
1136 /* Free response callback data */
1137 zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
1139 /* Send failure response */
1140 ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
1148 static void on_service_get_node_type_resp(ZigBeeServiceInterface *service_interface,
1149 guint request_id, gpointer resp_data, guint resp_data_len, gpointer resp_cb_data)
1151 ZigbeeServiceInterfaceRespCbData_t *cb_data =
1152 (ZigbeeServiceInterfaceRespCbData_t *)resp_cb_data;
1154 ZigbeeService *service_object;
1155 GDBusMethodInvocation *invocation;
1156 ZigbeeServiceServiceNodeTypeResp_t *payload =
1157 (ZigbeeServiceServiceNodeTypeResp_t *)resp_data;
1159 NOT_USED(service_interface);
1160 NOT_USED(request_id);
1162 if (NULL == resp_data || 0 == resp_data_len) {
1163 Z_LOGE("resp_data is null");
1168 service_object = zigbee_service_dbus_interface_ref_interface_object(cb_data);
1169 zblib_check_null_free_and_ret("service_object", service_object, cb_data);
1171 invocation = zigbee_service_dbus_interface_ref_invocation(cb_data);
1172 zblib_check_null_free_and_ret("invocation", invocation, cb_data);
1174 zigbee_service_complete_get_node_type(service_object, invocation,
1175 payload->result, payload->node_type);
1180 static gboolean on_service_get_node_type(ZigbeeService *service_object,
1181 GDBusMethodInvocation *invocation,
1185 ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
1186 ZigbeeServiceGetNodeType_t req;
1187 ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
1189 GVariantIter *iter = NULL;
1194 memset(&req, 0x0, sizeof(ZigbeeServiceGetNodeType_t));
1196 /* Update request structure */
1197 g_variant_get(eui64, "a(y)", &iter);
1198 while (g_variant_iter_loop(iter, "(y)", req.eui64[i])) {
1200 if (i >= ZIGBEE_EUI64_SIZE)
1204 /* Allocate response callback data */
1206 zigbee_service_dbus_interface_create_resp_cb_data(service_object,
1207 invocation, NULL, 0);
1208 if (NULL == resp_cb_data) {
1209 Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
1211 /* Send failure response */
1212 ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
1217 /* Dispatch request */
1218 ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
1219 ZBLIB_DRIVER_TYPE_SERVICE,
1220 ZBLIB_SERVICE_OPS_GET_NODE_TYPE,
1222 on_service_get_node_type_resp, resp_cb_data);
1224 Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
1226 /* Free response callback data */
1227 zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
1229 /* Send failure response */
1230 ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
1238 static gboolean on_service_check_privilege(ZigbeeService *service_object,
1239 GDBusMethodInvocation *invocation,
1242 NOT_USED(user_data);
1244 zigbee_service_complete_check_privilege(service_object, invocation);
1249 void zigbee_service_dbus_interface_service_notification(ZigBeeServiceInterface *service_interface,
1250 guint noti_id, gpointer noti_data, guint noti_data_len, gpointer noti_cb_data)
1252 ZigbeeService *service_object;
1254 zblib_check_null_ret("service_interface", service_interface);
1256 if (NULL == noti_data || 0 == noti_data_len) {
1257 Z_LOGE("noti_data is NULL");
1261 service_object = _service_interface_ref_zigbee_service(service_interface);
1262 zblib_check_null_ret("service_object", service_object);
1264 NOT_USED(noti_cb_data);
1267 case ZBLIB_SERVICE_NOTI_FORM_NETWORK_DONE: {
1268 ZigbeeServiceServiceFormNetworkDone_t *panid_t =
1269 (ZigbeeServiceServiceFormNetworkDone_t*)noti_data;
1271 Z_LOGD("form_network_done : [0x%X]", panid_t->pan_id);
1273 zigbee_service_emit_form_network_done(service_object, panid_t->pan_id);
1276 case ZBLIB_SERVICE_NOTI_CHILD_JOINED: {
1277 ZigbeeServiceServiceChildJoined_t *child_t =
1278 (ZigbeeServiceServiceChildJoined_t*)noti_data;
1280 GVariant *v_eui64 = NULL;
1281 GVariant *v_endpoints = NULL;
1283 v_eui64 = g_variant_new_from_data(G_VARIANT_TYPE("a(y)"),
1284 child_t->eui64, ZIGBEE_EUI64_SIZE, TRUE, NULL, NULL);
1285 v_endpoints = g_variant_new_from_data(G_VARIANT_TYPE("a(y)"),
1286 child_t->endpoints, child_t->endpoint_count, TRUE, NULL, NULL);
1287 if (NULL == v_eui64 || NULL == v_endpoints) {
1288 Z_LOGE("Failed to create variant!");
1290 zigbee_service_emit_child_joined(service_object,
1291 v_eui64, child_t->endpoint_count, v_endpoints, child_t->node_id);
1294 g_variant_unref(v_eui64);
1296 g_variant_unref(v_endpoints);
1299 case ZBLIB_SERVICE_NOTI_CHILD_REJOINED: {
1300 ZigbeeServiceServiceChildRejoined_t *child_t =
1301 (ZigbeeServiceServiceChildRejoined_t*)noti_data;
1303 GVariant *v_eui64 = g_variant_new_from_data(G_VARIANT_TYPE("a(y)"),
1304 child_t->eui64, ZIGBEE_EUI64_SIZE, TRUE, NULL, NULL);
1305 if (NULL == v_eui64)
1306 Z_LOGE("Failed to create variant!");
1308 zigbee_service_emit_child_rejoined(service_object, v_eui64);
1310 g_variant_unref(v_eui64);
1313 case ZBLIB_SERVICE_NOTI_CHILD_LEFT: {
1314 ZigbeeServiceServiceChildLeft_t *child_left_t =
1315 (ZigbeeServiceServiceChildLeft_t*)noti_data;
1317 GVariant *v_eui64 = g_variant_new_from_data(G_VARIANT_TYPE("a(y)"),
1318 child_left_t->eui64, ZIGBEE_EUI64_SIZE, TRUE, NULL, NULL);
1319 if (NULL == v_eui64)
1320 Z_LOGE("Failed to create variant!");
1322 zigbee_service_emit_child_left(service_object,
1323 v_eui64, child_left_t->status);
1324 g_variant_unref(v_eui64);
1328 case ZBLIB_SERVICE_NOTI_LEAVE_NETWORK_DONE: {
1329 ZigbeeServiceServiceLeaveNetworkDone_t leave_net_t;
1330 memcpy(&leave_net_t, noti_data, noti_data_len);
1331 zigbee_service_emit_leave_network_done(service_object, leave_net_t.pan_id);
1335 Z_LOGE("Unexpected notification [%x]", noti_id);
1339 /* ZigbeeService should be dereferenced */
1340 g_object_unref(service_object);
1342 /* LCOV_EXCL_STOP */
1344 gboolean zigbee_service_dbus_interface_service_init(ZigBeeServiceInterface *service_interface,
1345 ZigbeeObjectSkeleton *zigbee_object)
1347 ZigbeeService *service_object;
1349 if (NULL == service_interface) {
1350 /* LCOV_EXCL_START */
1351 Z_LOGE("service_interface is NULL");
1353 /* LCOV_EXCL_STOP */
1356 service_object = zigbee_service_skeleton_new();
1357 zigbee_object_skeleton_set_service(zigbee_object, service_object);
1358 g_object_unref(service_object);
1360 Z_LOGI("service_object: [%p]", service_object);
1363 * Register signal handlers for 'service' interface
1365 g_signal_connect(service_object,
1366 "handle-zb-hw-reset",
1367 G_CALLBACK(on_service_zb_hw_reset), service_interface);
1369 g_signal_connect(service_object,
1370 "handle-form-network",
1371 G_CALLBACK(on_service_form_network), service_interface);
1373 g_signal_connect(service_object,
1374 "handle-coex-start",
1375 G_CALLBACK(on_service_coex_start), service_interface);
1377 g_signal_connect(service_object,
1379 G_CALLBACK(on_service_coex_stop), service_interface);
1381 g_signal_connect(service_object,
1382 "handle-leave-network",
1383 G_CALLBACK(on_service_leave_network), service_interface);
1385 g_signal_connect(service_object,
1386 "handle-get-network-info",
1387 G_CALLBACK(on_service_get_network_info), service_interface);
1389 g_signal_connect(service_object,
1390 "handle-permit-join",
1391 G_CALLBACK(on_service_permit_join), service_interface);
1393 g_signal_connect(service_object,
1394 "handle-leave-request",
1395 G_CALLBACK(on_service_leave_request), service_interface);
1397 g_signal_connect(service_object,
1398 "handle-get-device-list",
1399 G_CALLBACK(on_service_get_device_list), service_interface);
1401 g_signal_connect(service_object,
1403 G_CALLBACK(on_service_get_mac), service_interface);
1405 g_signal_connect(service_object,
1406 "handle-get-device-info",
1407 G_CALLBACK(on_service_get_device_info), service_interface);
1409 g_signal_connect(service_object,
1410 "handle-get-endpoint-list",
1411 G_CALLBACK(on_service_get_endpoint_list), service_interface);
1413 g_signal_connect(service_object,
1414 "handle-get-cluster-list",
1415 G_CALLBACK(on_service_get_cluster_list), service_interface);
1417 g_signal_connect(service_object,
1418 "handle-get-node-type",
1419 G_CALLBACK(on_service_get_node_type), service_interface);
1421 g_signal_connect(service_object,
1422 "handle-check-privilege",
1423 G_CALLBACK(on_service_check_privilege), service_interface);