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>
23 static void *_service_interface_ref_zigbee_service(ZigBeeServiceInterface *service_interface)
25 ZigbeeObjectSkeleton *zigbee_object = NULL;
26 ZigbeeCustomData_t *custom_data = NULL;
27 ZigbeeService *service = NULL;
29 custom_data = (ZigbeeCustomData_t *)zblib_service_interface_ref_user_data(service_interface);
30 if (NULL == custom_data) {
31 Z_LOGE("D-BUS service interface custom_data is NULL!");
35 /* Get zigbee object */
36 zigbee_object = g_hash_table_lookup(custom_data->objects, ZIGBEE_SERVICE_PATH);
37 if (NULL == zigbee_object) {
38 Z_LOGW("Cannot find ZigBee D-BUS interface object!", zigbee_object);
42 service = zigbee_object_get_service(ZIGBEE_OBJECT(zigbee_object));
46 static void on_service_zb_hw_reset_resp(ZigBeeServiceInterface *service_interface,
47 guint request_id, gpointer resp_data, guint resp_data_len, gpointer resp_cb_data)
49 ZigbeeServiceInterfaceRespCbData_t *cb_data =
50 (ZigbeeServiceInterfaceRespCbData_t *)resp_cb_data;
52 ZigbeeService *service_object;
53 GDBusMethodInvocation *invocation;
54 ZigbeeGeneralResp_t *payload = (ZigbeeGeneralResp_t*)resp_data;
56 NOT_USED(service_interface);
59 if (NULL == resp_data || 0 == resp_data_len) {
60 Z_LOGE("resp_data is null");
65 service_object = zigbee_service_dbus_interface_ref_interface_object(cb_data);
66 zblib_check_null_free_and_ret("service_object", service_object, cb_data);
68 invocation = zigbee_service_dbus_interface_ref_invocation(cb_data);
69 zblib_check_null_free_and_ret("invocation", invocation, cb_data);
71 zigbee_service_complete_zb_hw_reset(service_object, invocation, payload->result);
76 static gboolean on_service_zb_hw_reset(ZigbeeService *service_object,
77 GDBusMethodInvocation *invocation,
80 ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
81 ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
85 /* Allocate response callback data */
87 zigbee_service_dbus_interface_create_resp_cb_data(service_object,
89 if (NULL == resp_cb_data) {
90 Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
92 /* Send failure response */
93 ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
98 /* Dispatch request */
99 ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
100 ZBLIB_DRIVER_TYPE_SERVICE,
101 ZBLIB_SERVICE_OPS_ZB_HW_RESET,
103 on_service_zb_hw_reset_resp, resp_cb_data);
105 Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
107 /* Free response callback data */
108 zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
110 /* Send failure response */
111 ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
119 static void on_service_form_network_resp(ZigBeeServiceInterface *service_interface,
120 guint request_id, gpointer resp_data, guint resp_data_len, gpointer resp_cb_data)
122 ZigbeeServiceInterfaceRespCbData_t *cb_data =
123 (ZigbeeServiceInterfaceRespCbData_t *)resp_cb_data;
125 ZigbeeService *service_object;
126 GDBusMethodInvocation *invocation;
127 ZigbeeGeneralResp_t *payload = (ZigbeeGeneralResp_t*)resp_data;
129 NOT_USED(service_interface);
130 NOT_USED(request_id);
132 if (NULL == resp_data || 0 == resp_data_len) {
133 Z_LOGE("resp_data is null");
138 service_object = zigbee_service_dbus_interface_ref_interface_object(cb_data);
139 zblib_check_null_free_and_ret("service_object", service_object, cb_data);
141 invocation = zigbee_service_dbus_interface_ref_invocation(cb_data);
142 zblib_check_null_free_and_ret("invocation", invocation, cb_data);
144 zigbee_service_complete_form_network(service_object, invocation, payload->result);
149 static gboolean on_service_form_network(ZigbeeService *service_object,
150 GDBusMethodInvocation *invocation,
153 ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
154 ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
158 /* Allocate response callback data */
160 zigbee_service_dbus_interface_create_resp_cb_data(service_object,
161 invocation, NULL, 0);
162 if (NULL == resp_cb_data) {
163 Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
165 /* Send failure response */
166 ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
171 /* Dispatch request */
172 ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
173 ZBLIB_DRIVER_TYPE_SERVICE,
174 ZBLIB_SERVICE_OPS_FORM_NETWORK,
176 on_service_form_network_resp, resp_cb_data);
178 Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
180 /* Free response callback data */
181 zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
183 /* Send failure response */
184 ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
192 static void on_service_coex_start_resp(ZigBeeServiceInterface *service_interface,
193 guint request_id, gpointer resp_data, guint resp_data_len, gpointer resp_cb_data)
195 ZigbeeServiceInterfaceRespCbData_t *cb_data =
196 (ZigbeeServiceInterfaceRespCbData_t *)resp_cb_data;
198 ZigbeeService *service_object;
199 GDBusMethodInvocation *invocation;
200 ZigbeeGeneralResp_t *payload = (ZigbeeGeneralResp_t*)resp_data;
202 NOT_USED(service_interface);
203 NOT_USED(request_id);
205 if (NULL == resp_data || 0 == resp_data_len) {
206 Z_LOGE("resp_data is null");
211 service_object = zigbee_service_dbus_interface_ref_interface_object(cb_data);
212 zblib_check_null_free_and_ret("service_object", service_object, cb_data);
214 invocation = zigbee_service_dbus_interface_ref_invocation(cb_data);
215 zblib_check_null_free_and_ret("invocation", invocation, cb_data);
217 zigbee_service_complete_coex_start(service_object, invocation, payload->result);
222 static gboolean on_service_coex_start(ZigbeeService *service_object,
223 GDBusMethodInvocation *invocation,
227 ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
228 ZigbeeServiceCoexStart_t req;
229 ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
233 memset(&req, 0x0, sizeof(ZigbeeServiceCoexStart_t));
235 /* Update request structure */
236 req.channel = channel;
238 /* Allocate response callback data */
240 zigbee_service_dbus_interface_create_resp_cb_data(service_object,
241 invocation, NULL, 0);
242 if (NULL == resp_cb_data) {
243 Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
245 /* Send failure response */
246 ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
251 /* Dispatch request */
252 ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
253 ZBLIB_DRIVER_TYPE_SERVICE,
254 ZBLIB_SERVICE_OPS_COEX_START,
256 on_service_coex_start_resp, resp_cb_data);
258 Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
260 /* Free response callback data */
261 zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
263 /* Send failure response */
264 ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
272 static void on_service_coex_stop_resp(ZigBeeServiceInterface *service_interface,
273 guint request_id, gpointer resp_data, guint resp_data_len, gpointer resp_cb_data)
275 ZigbeeServiceInterfaceRespCbData_t *cb_data =
276 (ZigbeeServiceInterfaceRespCbData_t *)resp_cb_data;
278 ZigbeeService *service_object;
279 GDBusMethodInvocation *invocation;
280 ZigbeeGeneralResp_t *payload = (ZigbeeGeneralResp_t*)resp_data;
282 NOT_USED(service_interface);
283 NOT_USED(request_id);
285 if (NULL == resp_data || 0 == resp_data_len) {
286 Z_LOGE("resp_data is null");
291 service_object = zigbee_service_dbus_interface_ref_interface_object(cb_data);
292 zblib_check_null_free_and_ret("service_object", service_object, cb_data);
294 invocation = zigbee_service_dbus_interface_ref_invocation(cb_data);
295 zblib_check_null_free_and_ret("invocation", invocation, cb_data);
297 zigbee_service_complete_coex_stop(service_object, invocation, payload->result);
302 static gboolean on_service_coex_stop(ZigbeeService *service_object,
303 GDBusMethodInvocation *invocation,
306 ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
307 ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
311 /* Allocate response callback data */
313 zigbee_service_dbus_interface_create_resp_cb_data(service_object,
314 invocation, NULL, 0);
315 if (NULL == resp_cb_data) {
316 Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
318 /* Send failure response */
319 ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
324 /* Dispatch request */
325 ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
326 ZBLIB_DRIVER_TYPE_SERVICE,
327 ZBLIB_SERVICE_OPS_COEX_STOP,
329 on_service_coex_stop_resp, resp_cb_data);
331 Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
333 /* Free response callback data */
334 zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
336 /* Send failure response */
337 ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
345 static void on_service_leave_network_resp(ZigBeeServiceInterface *service_interface,
346 guint request_id, gpointer resp_data, guint resp_data_len, gpointer resp_cb_data)
348 ZigbeeServiceInterfaceRespCbData_t *cb_data =
349 (ZigbeeServiceInterfaceRespCbData_t *)resp_cb_data;
351 ZigbeeService *service_object;
352 GDBusMethodInvocation *invocation;
353 ZigbeeGeneralResp_t *payload = (ZigbeeGeneralResp_t*)resp_data;
355 NOT_USED(service_interface);
356 NOT_USED(request_id);
358 if (NULL == resp_data || 0 == resp_data_len) {
359 Z_LOGE("resp_data is null");
364 service_object = zigbee_service_dbus_interface_ref_interface_object(cb_data);
365 zblib_check_null_free_and_ret("service_object", service_object, cb_data);
367 invocation = zigbee_service_dbus_interface_ref_invocation(cb_data);
368 zblib_check_null_free_and_ret("invocation", invocation, cb_data);
370 zigbee_service_complete_leave_network(service_object, invocation, payload->result);
375 static gboolean on_service_leave_network(ZigbeeService *service_object,
376 GDBusMethodInvocation *invocation,
379 ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
380 ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
384 /* Allocate response callback data */
386 zigbee_service_dbus_interface_create_resp_cb_data(service_object,
387 invocation, NULL, 0);
388 if (NULL == resp_cb_data) {
389 Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
391 /* Send failure response */
392 ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
397 /* Dispatch request */
398 ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
399 ZBLIB_DRIVER_TYPE_SERVICE,
400 ZBLIB_SERVICE_OPS_LEAVE_NETWORK,
402 on_service_leave_network_resp, resp_cb_data);
404 Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
406 /* Free response callback data */
407 zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
409 /* Send failure response */
410 ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
418 static void on_service_get_network_info_resp(ZigBeeServiceInterface *service_interface,
419 guint request_id, gpointer resp_data, guint resp_data_len, gpointer resp_cb_data)
421 ZigbeeServiceInterfaceRespCbData_t *cb_data =
422 (ZigbeeServiceInterfaceRespCbData_t *)resp_cb_data;
424 ZigbeeService *service_object;
425 GDBusMethodInvocation *invocation;
427 ZigbeeServiceGetNetworkInfoResp_t *payload =
428 (ZigbeeServiceGetNetworkInfoResp_t*)resp_data;
430 GVariant *v_eui64 = NULL;
432 NOT_USED(service_interface);
433 NOT_USED(request_id);
435 if (NULL == resp_data || 0 == resp_data_len) {
436 Z_LOGE("resp_data is null");
441 service_object = zigbee_service_dbus_interface_ref_interface_object(cb_data);
442 zblib_check_null_free_and_ret("service_object", service_object, cb_data);
444 invocation = zigbee_service_dbus_interface_ref_invocation(cb_data);
445 zblib_check_null_free_and_ret("invocation", invocation, cb_data);
447 v_eui64 = g_variant_new_from_data(G_VARIANT_TYPE("a(y)"),
448 payload->eui64, ZIGBEE_EUI64_SIZE, TRUE, NULL, NULL);
450 zigbee_service_complete_get_network_info(service_object, invocation,
451 payload->result, v_eui64, payload->node_id,
452 payload->pan_id, payload->channel, payload->radio_tx_power);
455 g_variant_unref(v_eui64);
460 static gboolean on_service_get_network_info(ZigbeeService *service_object,
461 GDBusMethodInvocation *invocation,
464 ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
465 ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
469 /* Allocate response callback data */
471 zigbee_service_dbus_interface_create_resp_cb_data(service_object,
472 invocation, NULL, 0);
473 if (NULL == resp_cb_data) {
474 Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
476 /* Send failure response */
477 ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
482 /* Dispatch request */
483 ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
484 ZBLIB_DRIVER_TYPE_SERVICE,
485 ZBLIB_SERVICE_OPS_GET_NETWORK_INFO,
487 on_service_get_network_info_resp, resp_cb_data);
489 Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
491 /* Free response callback data */
492 zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
494 /* Send failure response */
495 ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
503 static void on_service_permit_join_resp(ZigBeeServiceInterface *service_interface,
504 guint request_id, gpointer resp_data, guint resp_data_len, gpointer resp_cb_data)
506 ZigbeeServiceInterfaceRespCbData_t *cb_data =
507 (ZigbeeServiceInterfaceRespCbData_t *)resp_cb_data;
509 ZigbeeService *service_object;
510 GDBusMethodInvocation *invocation;
511 ZigbeeGeneralResp_t *payload = (ZigbeeGeneralResp_t*)resp_data;
513 NOT_USED(service_interface);
514 NOT_USED(request_id);
516 if (NULL == resp_data || 0 == resp_data_len) {
517 Z_LOGE("resp_data is null");
522 service_object = zigbee_service_dbus_interface_ref_interface_object(cb_data);
523 zblib_check_null_free_and_ret("service_object", service_object, cb_data);
525 invocation = zigbee_service_dbus_interface_ref_invocation(cb_data);
526 zblib_check_null_free_and_ret("invocation", invocation, cb_data);
528 zigbee_service_complete_permit_join(service_object, invocation, payload->result);
533 static gboolean on_service_permit_join(ZigbeeService *service_object,
534 GDBusMethodInvocation *invocation,
536 gboolean permit_join,
539 ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
540 ZigbeeServicePermitJoin_t req;
541 ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
545 memset(&req, 0x0, sizeof(ZigbeeServicePermitJoin_t));
547 /* Update request structure */
548 req.duration = duration;
549 req.permit_join = permit_join;
551 /* Allocate response callback data */
553 zigbee_service_dbus_interface_create_resp_cb_data(service_object,
554 invocation, NULL, 0);
555 if (NULL == resp_cb_data) {
556 Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
558 /* Send failure response */
559 ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
564 /* Dispatch request */
565 ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
566 ZBLIB_DRIVER_TYPE_SERVICE,
567 ZBLIB_SERVICE_OPS_PERMIT_JOIN,
569 on_service_permit_join_resp, resp_cb_data);
571 Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
573 /* Free response callback data */
574 zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
576 /* Send failure response */
577 ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
585 static void on_service_leave_request_resp(ZigBeeServiceInterface *service_interface,
586 guint request_id, gpointer resp_data, guint resp_data_len, gpointer resp_cb_data)
588 ZigbeeServiceInterfaceRespCbData_t *cb_data =
589 (ZigbeeServiceInterfaceRespCbData_t *)resp_cb_data;
591 ZigbeeService *service_object;
592 GDBusMethodInvocation *invocation;
593 ZigbeeGeneralResp_t *payload = (ZigbeeGeneralResp_t*)resp_data;
595 NOT_USED(service_interface);
596 NOT_USED(request_id);
598 if (NULL == resp_data || 0 == resp_data_len) {
599 Z_LOGE("resp_data is null");
604 service_object = zigbee_service_dbus_interface_ref_interface_object(cb_data);
605 zblib_check_null_free_and_ret("service_object", service_object, cb_data);
607 invocation = zigbee_service_dbus_interface_ref_invocation(cb_data);
608 zblib_check_null_free_and_ret("invocation", invocation, cb_data);
610 zigbee_service_complete_leave_request(service_object, invocation, payload->result);
615 static gboolean on_service_leave_request(ZigbeeService *service_object,
616 GDBusMethodInvocation *invocation,
622 ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
623 ZigbeeServiceLeaveRequest_t req;
624 ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
626 GVariantIter *iter = NULL;
631 memset(&req, 0x0, sizeof(ZigbeeServiceLeaveRequest_t));
633 /* Update request structure */
634 g_variant_get(eui64, "a(y)", &iter);
635 while (g_variant_iter_loop(iter, "(y)", &(req.eui64[i]))) {
637 if (i >= ZIGBEE_EUI64_SIZE)
640 req.remove_child = remove_child;
643 Z_LOGD("IEEE Address = %X:%X:%X:%X:%X:%X:%X:%X",
644 req.eui64[0], req.eui64[1], req.eui64[2], req.eui64[3],
645 req.eui64[4], req.eui64[5], req.eui64[6], req.eui64[7]);
646 Z_LOGD("remove_child [%d]", remove_child);
647 Z_LOGD("rejoin [%d]", rejoin);
649 /* Allocate response callback data */
651 zigbee_service_dbus_interface_create_resp_cb_data(service_object,
652 invocation, NULL, 0);
653 if (NULL == resp_cb_data) {
654 Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
656 /* Send failure response */
657 ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
662 /* Dispatch request */
663 ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
664 ZBLIB_DRIVER_TYPE_SERVICE,
665 ZBLIB_SERVICE_OPS_LEAVE_REQUEST,
667 on_service_leave_request_resp, resp_cb_data);
669 Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
671 /* Free response callback data */
672 zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
674 /* Send failure response */
675 ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
683 static void on_service_get_device_list_resp(ZigBeeServiceInterface *service_interface,
684 guint request_id, gpointer resp_data, guint resp_data_len, gpointer resp_cb_data)
686 ZigbeeServiceInterfaceRespCbData_t *cb_data =
687 (ZigbeeServiceInterfaceRespCbData_t *)resp_cb_data;
689 ZigbeeService *service_object;
690 GDBusMethodInvocation *invocation;
692 NOT_USED(service_interface);
693 NOT_USED(request_id);
695 if (NULL == resp_data || 0 == resp_data_len) {
696 Z_LOGE("resp_data is null");
701 service_object = zigbee_service_dbus_interface_ref_interface_object(cb_data);
702 zblib_check_null_free_and_ret("service_object", service_object, cb_data);
704 invocation = zigbee_service_dbus_interface_ref_invocation(cb_data);
705 zblib_check_null_free_and_ret("invocation", invocation, cb_data);
707 /* TODO : zigbee_service_complete_get_device_list */
708 /* zigbee_service_complete_get_device_list(service_object, invocation, resp_data); */
713 static gboolean on_service_get_device_list(ZigbeeService *service_object,
714 GDBusMethodInvocation *invocation,
717 ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
718 ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
722 /* Allocate response callback data */
724 zigbee_service_dbus_interface_create_resp_cb_data(service_object,
725 invocation, NULL, 0);
726 if (NULL == resp_cb_data) {
727 Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
729 /* Send failure response */
730 ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
735 /* Dispatch request */
736 ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
737 ZBLIB_DRIVER_TYPE_SERVICE,
738 ZBLIB_SERVICE_OPS_GET_DEVICE_LIST,
740 on_service_get_device_list_resp, resp_cb_data);
742 Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
744 /* Free response callback data */
745 zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
747 /* Send failure response */
748 ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
756 static void on_service_get_mac_resp(ZigBeeServiceInterface *service_interface,
757 guint request_id, gpointer resp_data, guint resp_data_len, gpointer resp_cb_data)
759 ZigbeeServiceInterfaceRespCbData_t *cb_data =
760 (ZigbeeServiceInterfaceRespCbData_t *)resp_cb_data;
762 ZigbeeService *service_object;
763 GDBusMethodInvocation *invocation;
764 ZigbeeServiceGetMacResp_t *payload =
765 (ZigbeeServiceGetMacResp_t*)resp_data;
767 GVariant *v_eui64 = NULL;
769 NOT_USED(service_interface);
770 NOT_USED(request_id);
772 if (NULL == resp_data || 0 == resp_data_len) {
773 Z_LOGE("resp_data is null");
778 service_object = zigbee_service_dbus_interface_ref_interface_object(cb_data);
779 zblib_check_null_free_and_ret("service_object", service_object, cb_data);
781 invocation = zigbee_service_dbus_interface_ref_invocation(cb_data);
782 zblib_check_null_free_and_ret("invocation", invocation, cb_data);
784 v_eui64 = g_variant_new_from_data(G_VARIANT_TYPE("a(y)"),
785 payload->eui64, ZIGBEE_EUI64_SIZE, TRUE, NULL, NULL);
787 zigbee_service_complete_get_mac(service_object, invocation, payload->result,
791 g_variant_unref(v_eui64);
796 static gboolean on_service_get_mac(ZigbeeService *service_object,
797 GDBusMethodInvocation *invocation,
800 ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
801 ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
805 /* Allocate response callback data */
807 zigbee_service_dbus_interface_create_resp_cb_data(service_object,
808 invocation, NULL, 0);
809 if (NULL == resp_cb_data) {
810 Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
812 /* Send failure response */
813 ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
818 /* Dispatch request */
819 ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
820 ZBLIB_DRIVER_TYPE_SERVICE,
821 ZBLIB_SERVICE_OPS_GET_MAC,
823 on_service_get_mac_resp, resp_cb_data);
825 Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
827 /* Free response callback data */
828 zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
830 /* Send failure response */
831 ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
839 static void on_service_get_device_info_resp(ZigBeeServiceInterface *service_interface,
840 guint request_id, gpointer resp_data, guint resp_data_len, gpointer resp_cb_data)
842 ZigbeeServiceInterfaceRespCbData_t *cb_data =
843 (ZigbeeServiceInterfaceRespCbData_t *)resp_cb_data;
845 ZigbeeService *service_object;
846 GDBusMethodInvocation *invocation;
847 ZigbeeServiceGetDeviceInfoResp_t *payload =
848 (ZigbeeServiceGetDeviceInfoResp_t*)resp_data;
850 GVariant *variant = NULL;
851 GVariantBuilder* builder = NULL;
855 NOT_USED(service_interface);
856 NOT_USED(request_id);
858 if (NULL == resp_data || 0 == resp_data_len) {
859 Z_LOGE("resp_data is null");
864 service_object = zigbee_service_dbus_interface_ref_interface_object(cb_data);
865 zblib_check_null_free_and_ret("service_object", service_object, cb_data);
867 invocation = zigbee_service_dbus_interface_ref_invocation(cb_data);
868 zblib_check_null_free_and_ret("invocation", invocation, cb_data);
870 builder = g_variant_builder_new(G_VARIANT_TYPE("a(qyayyay)"));
871 for (index = 0; index < payload->count; index++) {
872 ZigbeeServiceGetDeviceInfoDetailResp_t *device = &(payload->list[index]);
873 GVariantBuilder* mac_builder = g_variant_builder_new(G_VARIANT_TYPE("ay"));
874 GVariantBuilder* endpoint_builder = g_variant_builder_new(G_VARIANT_TYPE("ay"));
876 for (i = 0; i < ZIGBEE_EUI64_SIZE; i++)
877 g_variant_builder_add(mac_builder, "y", device->eui64[i]);
878 for (i = 0; i < device->endpoint_count; i++)
879 g_variant_builder_add(endpoint_builder, "y", device->endpoints[i]);
881 g_variant_builder_add(builder, "(qyayyay)",
882 device->node_id, device->node_type,
883 mac_builder, device->endpoint_count, endpoint_builder);
885 g_variant_builder_unref(mac_builder);
886 g_variant_builder_unref(endpoint_builder);
889 variant = g_variant_builder_end(builder);
890 zigbee_service_complete_get_device_info(service_object, invocation,
891 payload->result, variant);
894 g_variant_unref(variant);
899 static gboolean on_service_get_device_info(ZigbeeService *service_object,
900 GDBusMethodInvocation *invocation,
903 ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
904 ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
908 /* Allocate response callback data */
910 zigbee_service_dbus_interface_create_resp_cb_data(service_object,
911 invocation, NULL, 0);
912 if (NULL == resp_cb_data) {
913 Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
915 /* Send failure response */
916 ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
921 /* Dispatch request */
922 ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
923 ZBLIB_DRIVER_TYPE_SERVICE,
924 ZBLIB_SERVICE_OPS_GET_DEVICE_INFO,
926 on_service_get_device_info_resp, resp_cb_data);
928 Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
930 /* Free response callback data */
931 zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
933 /* Send failure response */
934 ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
942 static void on_service_get_endpoint_list_resp(ZigBeeServiceInterface *service_interface,
943 guint request_id, gpointer resp_data, guint resp_data_len, gpointer resp_cb_data)
945 ZigbeeServiceInterfaceRespCbData_t *cb_data =
946 (ZigbeeServiceInterfaceRespCbData_t *)resp_cb_data;
948 ZigbeeService *service_object;
949 GDBusMethodInvocation *invocation;
950 ZigbeeServiceGetEndpointListResp_t *payload =
951 (ZigbeeServiceGetEndpointListResp_t*)resp_data;
952 GVariant *v_endpoints = NULL;
954 NOT_USED(service_interface);
955 NOT_USED(request_id);
957 if (NULL == resp_data || 0 == resp_data_len) {
958 Z_LOGE("resp_data is null");
963 service_object = zigbee_service_dbus_interface_ref_interface_object(cb_data);
964 zblib_check_null_free_and_ret("service_object", service_object, cb_data);
966 invocation = zigbee_service_dbus_interface_ref_invocation(cb_data);
967 zblib_check_null_free_and_ret("invocation", invocation, cb_data);
969 v_endpoints = g_variant_new_from_data(G_VARIANT_TYPE("a(y)"),
970 payload->endpoints, payload->endpoint_count, TRUE, NULL, NULL);
972 zigbee_service_complete_get_endpoint_list(service_object, invocation,
973 payload->result, v_endpoints);
976 g_variant_unref(v_endpoints);
981 static gboolean on_service_get_endpoint_list(ZigbeeService *service_object,
982 GDBusMethodInvocation *invocation,
986 ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
987 ZigbeeServiceGetEndpointList_t req;
988 ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
990 GVariantIter *iter = NULL;
995 memset(&req, 0x0, sizeof(ZigbeeServiceGetEndpointList_t));
997 /* Update request structure */
998 g_variant_get(eui64, "a(y)", &iter);
999 while (g_variant_iter_loop(iter, "(y)", &(req.eui64[i]))) {
1001 if (i >= ZIGBEE_EUI64_SIZE)
1005 /* Allocate response callback data */
1007 zigbee_service_dbus_interface_create_resp_cb_data(service_object,
1008 invocation, NULL, 0);
1009 if (NULL == resp_cb_data) {
1010 Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
1012 /* Send failure response */
1013 ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
1018 /* Dispatch request */
1019 ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
1020 ZBLIB_DRIVER_TYPE_SERVICE,
1021 ZBLIB_SERVICE_OPS_GET_ENDPOINT_LIST,
1023 on_service_get_endpoint_list_resp, resp_cb_data);
1025 Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
1027 /* Free response callback data */
1028 zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
1030 /* Send failure response */
1031 ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
1039 static void on_service_get_cluster_list_resp(ZigBeeServiceInterface *service_interface,
1040 guint request_id, gpointer resp_data, guint resp_data_len, gpointer resp_cb_data)
1042 ZigbeeServiceInterfaceRespCbData_t *cb_data =
1043 (ZigbeeServiceInterfaceRespCbData_t *)resp_cb_data;
1045 ZigbeeService *service_object;
1046 GDBusMethodInvocation *invocation;
1047 ZigbeeServiceGetClusterListResp_t *payload =
1048 (ZigbeeServiceGetClusterListResp_t*)resp_data;
1049 GVariant *v_in_clusters = NULL;
1050 GVariant *v_out_clusters = NULL;
1052 NOT_USED(service_interface);
1053 NOT_USED(request_id);
1055 if (NULL == resp_data || 0 == resp_data_len) {
1056 Z_LOGE("resp_data is null");
1061 service_object = zigbee_service_dbus_interface_ref_interface_object(cb_data);
1062 zblib_check_null_free_and_ret("service_object", service_object, cb_data);
1064 invocation = zigbee_service_dbus_interface_ref_invocation(cb_data);
1065 zblib_check_null_free_and_ret("invocation", invocation, cb_data);
1067 v_in_clusters = g_variant_new_from_data(G_VARIANT_TYPE("aq"),
1068 payload->in_clusters, (payload->in_cluster_count * sizeof(unsigned short)),
1070 v_out_clusters = g_variant_new_from_data(G_VARIANT_TYPE("aq"),
1071 payload->out_clusters, (payload->out_cluster_count * sizeof(unsigned short)),
1074 zigbee_service_complete_get_cluster_list(service_object, invocation,
1075 payload->result, v_in_clusters, v_out_clusters);
1078 g_variant_unref(v_in_clusters);
1080 g_variant_unref(v_out_clusters);
1085 static gboolean on_service_get_cluster_list(ZigbeeService *service_object,
1086 GDBusMethodInvocation *invocation,
1091 ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
1092 ZigbeeServiceGetClusterList_t req;
1093 ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
1095 GVariantIter *iter = NULL;
1100 memset(&req, 0x0, sizeof(ZigbeeServiceGetClusterList_t));
1102 /* Update request structure */
1103 g_variant_get(eui64, "a(y)", &iter);
1104 while (g_variant_iter_loop(iter, "(y)", &(req.eui64[i]))) {
1106 if (i >= ZIGBEE_EUI64_SIZE)
1109 req.endpoint = endpoint;
1111 /* Allocate response callback data */
1113 zigbee_service_dbus_interface_create_resp_cb_data(service_object,
1114 invocation, NULL, 0);
1115 if (NULL == resp_cb_data) {
1116 Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
1118 /* Send failure response */
1119 ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
1124 /* Dispatch request */
1125 ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
1126 ZBLIB_DRIVER_TYPE_SERVICE,
1127 ZBLIB_SERVICE_OPS_GET_CLUSTER_LIST,
1129 on_service_get_cluster_list_resp, resp_cb_data);
1131 Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
1133 /* Free response callback data */
1134 zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
1136 /* Send failure response */
1137 ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
1145 static void on_service_get_node_type_resp(ZigBeeServiceInterface *service_interface,
1146 guint request_id, gpointer resp_data, guint resp_data_len, gpointer resp_cb_data)
1148 ZigbeeServiceInterfaceRespCbData_t *cb_data =
1149 (ZigbeeServiceInterfaceRespCbData_t *)resp_cb_data;
1151 ZigbeeService *service_object;
1152 GDBusMethodInvocation *invocation;
1153 ZigbeeServiceServiceNodeTypeResp_t *payload =
1154 (ZigbeeServiceServiceNodeTypeResp_t *)resp_data;
1156 NOT_USED(service_interface);
1157 NOT_USED(request_id);
1159 if (NULL == resp_data || 0 == resp_data_len) {
1160 Z_LOGE("resp_data is null");
1165 service_object = zigbee_service_dbus_interface_ref_interface_object(cb_data);
1166 zblib_check_null_free_and_ret("service_object", service_object, cb_data);
1168 invocation = zigbee_service_dbus_interface_ref_invocation(cb_data);
1169 zblib_check_null_free_and_ret("invocation", invocation, cb_data);
1171 zigbee_service_complete_get_node_type(service_object, invocation,
1172 payload->result, payload->node_type);
1177 static gboolean on_service_get_node_type(ZigbeeService *service_object,
1178 GDBusMethodInvocation *invocation,
1182 ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
1183 ZigbeeServiceGetNodeType_t req;
1184 ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
1186 GVariantIter *iter = NULL;
1191 memset(&req, 0x0, sizeof(ZigbeeServiceGetNodeType_t));
1193 /* Update request structure */
1194 g_variant_get(eui64, "a(y)", &iter);
1195 while (g_variant_iter_loop(iter, "(y)", req.eui64[i])) {
1197 if (i >= ZIGBEE_EUI64_SIZE)
1201 /* Allocate response callback data */
1203 zigbee_service_dbus_interface_create_resp_cb_data(service_object,
1204 invocation, NULL, 0);
1205 if (NULL == resp_cb_data) {
1206 Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
1208 /* Send failure response */
1209 ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
1214 /* Dispatch request */
1215 ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
1216 ZBLIB_DRIVER_TYPE_SERVICE,
1217 ZBLIB_SERVICE_OPS_GET_NODE_TYPE,
1219 on_service_get_node_type_resp, resp_cb_data);
1221 Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
1223 /* Free response callback data */
1224 zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
1226 /* Send failure response */
1227 ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
1235 static gboolean on_service_check_privilege(ZigbeeService *service_object,
1236 GDBusMethodInvocation *invocation,
1239 NOT_USED(user_data);
1241 zigbee_service_complete_check_privilege(service_object, invocation);
1246 void zigbee_service_dbus_interface_service_notification(ZigBeeServiceInterface *service_interface,
1247 guint noti_id, gpointer noti_data, guint noti_data_len, gpointer noti_cb_data)
1249 ZigbeeService *service_object;
1251 zblib_check_null_ret("service_interface", service_interface);
1253 if (NULL == noti_data || 0 == noti_data_len) {
1254 Z_LOGE("noti_data is NULL");
1258 service_object = _service_interface_ref_zigbee_service(service_interface);
1259 zblib_check_null_ret("service_object", service_object);
1261 NOT_USED(noti_cb_data);
1264 case ZBLIB_SERVICE_NOTI_FORM_NETWORK_DONE: {
1265 ZigbeeServiceServiceFormNetworkDone_t *panid_t =
1266 (ZigbeeServiceServiceFormNetworkDone_t*)noti_data;
1268 Z_LOGD("form_network_done : [0x%X]", panid_t->pan_id);
1270 zigbee_service_emit_form_network_done(service_object, panid_t->pan_id);
1273 case ZBLIB_SERVICE_NOTI_CHILD_JOINED: {
1274 ZigbeeServiceServiceChildJoined_t *child_t =
1275 (ZigbeeServiceServiceChildJoined_t*)noti_data;
1277 GVariant *v_eui64 = NULL;
1278 GVariant *v_endpoints = NULL;
1280 v_eui64 = g_variant_new_from_data(G_VARIANT_TYPE("a(y)"),
1281 child_t->eui64, ZIGBEE_EUI64_SIZE, TRUE, NULL, NULL);
1282 v_endpoints = g_variant_new_from_data(G_VARIANT_TYPE("a(y)"),
1283 child_t->endpoints, child_t->endpoint_count, TRUE, NULL, NULL);
1284 if (NULL == v_eui64 || NULL == v_endpoints) {
1285 Z_LOGE("Failed to create variant!");
1287 zigbee_service_emit_child_joined(service_object,
1288 v_eui64, child_t->endpoint_count, v_endpoints, child_t->node_id);
1291 g_variant_unref(v_eui64);
1293 g_variant_unref(v_endpoints);
1296 case ZBLIB_SERVICE_NOTI_CHILD_REJOINED: {
1297 ZigbeeServiceServiceChildRejoined_t *child_t =
1298 (ZigbeeServiceServiceChildRejoined_t*)noti_data;
1300 GVariant *v_eui64 = g_variant_new_from_data(G_VARIANT_TYPE("a(y)"),
1301 child_t->eui64, ZIGBEE_EUI64_SIZE, TRUE, NULL, NULL);
1302 if (NULL == v_eui64)
1303 Z_LOGE("Failed to create variant!");
1305 zigbee_service_emit_child_rejoined(service_object, v_eui64);
1307 g_variant_unref(v_eui64);
1310 case ZBLIB_SERVICE_NOTI_CHILD_LEFT: {
1311 ZigbeeServiceServiceChildLeft_t *child_left_t =
1312 (ZigbeeServiceServiceChildLeft_t*)noti_data;
1314 GVariant *v_eui64 = g_variant_new_from_data(G_VARIANT_TYPE("a(y)"),
1315 child_left_t->eui64, ZIGBEE_EUI64_SIZE, TRUE, NULL, NULL);
1316 if (NULL == v_eui64)
1317 Z_LOGE("Failed to create variant!");
1319 zigbee_service_emit_child_left(service_object,
1320 v_eui64, child_left_t->status);
1321 g_variant_unref(v_eui64);
1325 case ZBLIB_SERVICE_NOTI_LEAVE_NETWORK_DONE: {
1326 ZigbeeServiceServiceLeaveNetworkDone_t leave_net_t;
1327 memcpy(&leave_net_t, noti_data, noti_data_len);
1328 zigbee_service_emit_leave_network_done(service_object, leave_net_t.pan_id);
1332 Z_LOGE("Unexpected notification [%x]", noti_id);
1336 /* ZigbeeService should be dereferenced */
1337 g_object_unref(service_object);
1340 gboolean zigbee_service_dbus_interface_service_init(ZigBeeServiceInterface *service_interface,
1341 ZigbeeObjectSkeleton *zigbee_object)
1343 ZigbeeService *service_object;
1345 if (NULL == service_interface) {
1346 Z_LOGE("service_interface is NULL");
1350 service_object = zigbee_service_skeleton_new();
1351 zigbee_object_skeleton_set_service(zigbee_object, service_object);
1352 g_object_unref(service_object);
1354 Z_LOGI("service_object: [%p]", service_object);
1357 * Register signal handlers for 'service' interface
1359 g_signal_connect(service_object,
1360 "handle-zb-hw-reset",
1361 G_CALLBACK(on_service_zb_hw_reset), service_interface);
1363 g_signal_connect(service_object,
1364 "handle-form-network",
1365 G_CALLBACK(on_service_form_network), service_interface);
1367 g_signal_connect(service_object,
1368 "handle-coex-start",
1369 G_CALLBACK(on_service_coex_start), service_interface);
1371 g_signal_connect(service_object,
1373 G_CALLBACK(on_service_coex_stop), service_interface);
1375 g_signal_connect(service_object,
1376 "handle-leave-network",
1377 G_CALLBACK(on_service_leave_network), service_interface);
1379 g_signal_connect(service_object,
1380 "handle-get-network-info",
1381 G_CALLBACK(on_service_get_network_info), service_interface);
1383 g_signal_connect(service_object,
1384 "handle-permit-join",
1385 G_CALLBACK(on_service_permit_join), service_interface);
1387 g_signal_connect(service_object,
1388 "handle-leave-request",
1389 G_CALLBACK(on_service_leave_request), service_interface);
1391 g_signal_connect(service_object,
1392 "handle-get-device-list",
1393 G_CALLBACK(on_service_get_device_list), service_interface);
1395 g_signal_connect(service_object,
1397 G_CALLBACK(on_service_get_mac), service_interface);
1399 g_signal_connect(service_object,
1400 "handle-get-device-info",
1401 G_CALLBACK(on_service_get_device_info), service_interface);
1403 g_signal_connect(service_object,
1404 "handle-get-endpoint-list",
1405 G_CALLBACK(on_service_get_endpoint_list), service_interface);
1407 g_signal_connect(service_object,
1408 "handle-get-cluster-list",
1409 G_CALLBACK(on_service_get_cluster_list), service_interface);
1411 g_signal_connect(service_object,
1412 "handle-get-node-type",
1413 G_CALLBACK(on_service_get_node_type), service_interface);
1415 g_signal_connect(service_object,
1416 "handle-check-privilege",
1417 G_CALLBACK(on_service_check_privilege), service_interface);