4 * Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
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.
21 #include <dbus/dbus-glib.h>
22 #include <dbus/dbus-glib-bindings.h>
23 #include <dbus/dbus-glib-lowlevel.h>
27 #include "bluetooth-api.h"
28 #include "bt-service-common.h"
29 #include "bt-service-util.h"
30 #include "bt-service-event.h"
31 #include "bt-service-adapter.h"
32 #include "bt-service-device.h"
33 #include "bt-service-hid.h"
34 #include "bt-service-network.h"
35 #include "bt-service-audio.h"
36 #include "bt-service-oob.h"
37 #include "bt-service-avrcp.h"
38 #include "bt-service-opp-client.h"
39 #include "bt-service-obex-server.h"
40 #include "bt-service-rfcomm-client.h"
41 #include "bt-service-rfcomm-server.h"
42 #include "bt-request-handler.h"
44 /* auto generated header by bt-request-service.xml*/
45 #include "bt-service-method.h"
47 DBusGConnection *bt_service_conn;
48 BtService *service_object;
50 GType bt_service_get_type (void);
52 G_DEFINE_TYPE(BtService, bt_service, G_TYPE_OBJECT);
54 /*This is part of platform provided code skeleton for client server model*/
55 static void bt_service_class_init (BtServiceClass *service_class)
57 dbus_g_object_type_install_info(G_TYPE_FROM_CLASS(service_class),
58 &dbus_glib_bt_object_info);
61 /*This is part of platform provided code skeleton for client server model*/
62 static void bt_service_init (BtService *service)
66 static int __bt_bluez_request(int function_name,
69 DBusGMethodInvocation *context,
76 int result = BLUETOOTH_ERROR_NONE;
78 switch (function_name) {
79 case BT_ENABLE_ADAPTER:
80 result = _bt_enable_adapter();
82 case BT_DISABLE_ADAPTER:
83 result = _bt_disable_adapter();
85 case BT_RESET_ADAPTER:
86 result = _bt_reset_adapter();
88 case BT_CHECK_ADAPTER: {
91 result = _bt_check_adapter(&enabled);
93 g_array_append_vals(*out_param1, &enabled,
97 case BT_GET_LOCAL_ADDRESS: {
98 bluetooth_device_address_t local_address = { {0} };
99 result = _bt_get_local_address(&local_address);
101 g_array_append_vals(*out_param1, &local_address,
102 sizeof(bluetooth_device_address_t));
105 case BT_GET_LOCAL_NAME: {
106 bluetooth_device_name_t local_name = { {0} };
107 result = _bt_get_local_name(&local_name);
109 g_array_append_vals(*out_param1, &local_name,
110 sizeof(bluetooth_device_name_t));
114 case BT_SET_LOCAL_NAME: {
115 bluetooth_device_name_t local_name = { {0} };
117 local_name = g_array_index(in_param1,
118 bluetooth_device_name_t, 0);
120 result = _bt_set_local_name(local_name.name);
124 case BT_IS_SERVICE_USED: {
126 gboolean used = FALSE;
128 uuid = &g_array_index(in_param1, char, 0);
130 result = _bt_is_service_used(uuid, &used);
132 if (result == BLUETOOTH_ERROR_NONE) {
133 g_array_append_vals(*out_param1, &used,
138 case BT_GET_DISCOVERABLE_MODE: {
139 int mode = BLUETOOTH_DISCOVERABLE_MODE_CONNECTABLE;
141 result = _bt_get_discoverable_mode(&mode);
143 g_array_append_vals(*out_param1, &mode, sizeof(int));
146 case BT_SET_DISCOVERABLE_MODE: {
147 int mode = BLUETOOTH_DISCOVERABLE_MODE_CONNECTABLE;
150 mode = g_array_index(in_param1, int, 0);
151 time = g_array_index(in_param2, int, 0);
153 result = _bt_set_discoverable_mode(mode, time);
156 case BT_GET_DISCOVERABLE_TIME: {
159 result = _bt_get_timeout_value(&timeout);
161 g_array_append_vals(*out_param1, &timeout, sizeof(int));
164 case BT_START_DISCOVERY:
165 result = _bt_start_discovery();
168 case BT_CANCEL_DISCOVERY:
169 result = _bt_cancel_discovery();
172 case BT_IS_DISCOVERYING: {
173 gboolean discovering = FALSE;
174 discovering = _bt_is_discovering();
176 g_array_append_vals(*out_param1, &discovering, sizeof(gboolean));
179 case BT_GET_BONDED_DEVICES:
180 result = _bt_get_bonded_devices(out_param1);
183 case BT_GET_BONDED_DEVICE: {
184 bluetooth_device_address_t address = { {0} };
185 bluetooth_device_info_t dev_info;
187 address = g_array_index(in_param1,
188 bluetooth_device_address_t, 0);
190 memset(&dev_info, 0x00, sizeof(bluetooth_device_info_t));
191 result = _bt_get_bonded_device_info(&address, &dev_info);
193 if (result == BLUETOOTH_ERROR_NONE) {
194 g_array_append_vals(*out_param1, &dev_info,
195 sizeof(bluetooth_device_info_t));
199 case BT_BOND_DEVICE: {
200 bluetooth_device_address_t address = { {0} };
202 address = g_array_index(in_param1,
203 bluetooth_device_address_t, 0);
205 result = _bt_bond_device(request_id, &address, out_param1);
208 case BT_CANCEL_BONDING: {
209 result = _bt_cancel_bonding();
212 case BT_UNBOND_DEVICE: {
213 bluetooth_device_address_t address = { {0} };
215 address = g_array_index(in_param1,
216 bluetooth_device_address_t, 0);
218 result = _bt_unbond_device(request_id, &address, out_param1);
223 bluetooth_device_address_t address = { {0} };
224 const char *local_name;
226 address = g_array_index(in_param1,
227 bluetooth_device_address_t, 0);
229 local_name = &g_array_index(in_param2, char, 0);
231 result = _bt_set_alias(&address, local_name);
234 case BT_SEARCH_SERVICE: {
235 bluetooth_device_address_t address = { {0} };
237 address = g_array_index(in_param1,
238 bluetooth_device_address_t, 0);
240 result = _bt_search_device(request_id, &address);
241 if (result != BLUETOOTH_ERROR_NONE) {
242 g_array_append_vals(*out_param1, &address,
243 sizeof(bluetooth_device_address_t));
247 case BT_CANCEL_SEARCH_SERVICE: {
248 result = _bt_cancel_search_device();
251 case BT_SET_AUTHORIZATION: {
252 bluetooth_device_address_t address = { {0} };
255 address = g_array_index(in_param1,
256 bluetooth_device_address_t, 0);
258 authorize = g_array_index(in_param2, gboolean, 0);
260 result = _bt_set_authorization(&address, authorize);
263 case BT_IS_DEVICE_CONNECTED: {
264 bluetooth_device_address_t address = { {0} };
266 gboolean connected = FALSE;
268 address = g_array_index(in_param1,
269 bluetooth_device_address_t, 0);
271 type = g_array_index(in_param2, int, 0);
273 result = _bt_is_device_connected(&address, type, &connected);
275 if (result == BLUETOOTH_ERROR_NONE) {
276 g_array_append_vals(*out_param1, &connected,
282 case BT_HID_CONNECT: {
283 bluetooth_device_address_t address = { {0} };
285 address = g_array_index(in_param1,
286 bluetooth_device_address_t, 0);
288 result = _bt_hid_connect(request_id, &address);
289 if (result != BLUETOOTH_ERROR_NONE) {
290 g_array_append_vals(*out_param1, &address,
291 sizeof(bluetooth_device_address_t));
295 case BT_HID_DISCONNECT: {
296 bluetooth_device_address_t address = { {0} };
298 address = g_array_index(in_param1,
299 bluetooth_device_address_t, 0);
301 result = _bt_hid_disconnect(request_id, &address);
302 if (result != BLUETOOTH_ERROR_NONE) {
303 g_array_append_vals(*out_param1, &address,
304 sizeof(bluetooth_device_address_t));
308 case BT_NETWORK_ACTIVATE:
309 result = _bt_network_activate();
311 case BT_NETWORK_DEACTIVATE:
312 result = _bt_network_deactivate();
314 case BT_NETWORK_CONNECT: {
315 bluetooth_device_address_t address = { {0} };
318 address = g_array_index(in_param1,
319 bluetooth_device_address_t, 0);
321 role = g_array_index(in_param2, int, 0);
323 result = _bt_network_connect(request_id, role, &address);
324 if (result != BLUETOOTH_ERROR_NONE) {
325 g_array_append_vals(*out_param1, &address,
326 sizeof(bluetooth_device_address_t));
330 case BT_NETWORK_DISCONNECT: {
331 bluetooth_device_address_t address = { {0} };
333 address = g_array_index(in_param1,
334 bluetooth_device_address_t, 0);
336 result = _bt_network_disconnect(request_id, &address);
337 if (result != BLUETOOTH_ERROR_NONE) {
338 g_array_append_vals(*out_param1, &address,
339 sizeof(bluetooth_device_address_t));
343 case BT_AUDIO_CONNECT: {
344 bluetooth_device_address_t address = { {0} };
346 address = g_array_index(in_param1,
347 bluetooth_device_address_t, 0);
349 result = _bt_audio_connect(request_id, BT_AUDIO_ALL,
350 &address, out_param1);
353 case BT_AUDIO_DISCONNECT: {
354 bluetooth_device_address_t address = { {0} };
356 address = g_array_index(in_param1,
357 bluetooth_device_address_t, 0);
359 result = _bt_audio_disconnect(request_id, BT_AUDIO_ALL,
360 &address, out_param1);
363 case BT_AG_CONNECT: {
364 bluetooth_device_address_t address = { {0} };
366 address = g_array_index(in_param1,
367 bluetooth_device_address_t, 0);
369 result = _bt_audio_connect(request_id, BT_AUDIO_HSP,
370 &address, out_param1);
373 case BT_AG_DISCONNECT: {
374 bluetooth_device_address_t address = { {0} };
376 address = g_array_index(in_param1,
377 bluetooth_device_address_t, 0);
379 result = _bt_audio_disconnect(request_id, BT_AUDIO_HSP,
380 &address, out_param1);
383 case BT_AV_CONNECT: {
384 bluetooth_device_address_t address = { {0} };
386 address = g_array_index(in_param1,
387 bluetooth_device_address_t, 0);
389 result = _bt_audio_connect(request_id, BT_AUDIO_A2DP,
390 &address, out_param1);
393 case BT_AV_DISCONNECT: {
394 bluetooth_device_address_t address = { {0} };
396 address = g_array_index(in_param1,
397 bluetooth_device_address_t, 0);
399 result = _bt_audio_disconnect(request_id, BT_AUDIO_A2DP,
400 &address, out_param1);
403 case BT_GET_SPEAKER_GAIN: {
406 result = _bt_audio_get_speaker_gain(&volume);
408 g_array_append_vals(*out_param1, &volume,
409 sizeof(unsigned int));
412 case BT_SET_SPEAKER_GAIN: {
415 volume = g_array_index(in_param1,
418 result = _bt_audio_set_speaker_gain(volume);
422 case BT_OOB_READ_LOCAL_DATA: {
423 bt_oob_data_t local_oob_data;
425 memset(&local_oob_data, 0x00, sizeof(bt_oob_data_t));
426 result = _bt_oob_read_local_data(&local_oob_data);
428 g_array_append_vals(*out_param1, &local_oob_data,
429 sizeof(bt_oob_data_t));
433 case BT_OOB_ADD_REMOTE_DATA: {
434 bluetooth_device_address_t address = { {0} };
435 bt_oob_data_t local_oob_data;
437 address = g_array_index(in_param1,
438 bluetooth_device_address_t, 0);
440 local_oob_data = g_array_index(in_param2,
443 result = _bt_oob_add_remote_data(&address, &local_oob_data);
447 case BT_OOB_REMOVE_REMOTE_DATA: {
448 bluetooth_device_address_t address = { {0} };
450 address = g_array_index(in_param1,
451 bluetooth_device_address_t, 0);
453 result = _bt_oob_remove_remote_data(&address);
457 case BT_AVRCP_SET_TRACK_INFO: {
458 media_metadata_t data;
459 media_player_settings_t properties;
461 memset(&data, 0x00, sizeof(media_metadata_t));
462 memset(&properties, 0x00, sizeof(media_player_settings_t));
464 data = g_array_index(in_param1,
465 media_metadata_t, 0);
467 properties.metadata.title = g_strdup(data.title);
468 properties.metadata.artists = g_malloc0(sizeof(char *));
469 properties.metadata.artists[0] = g_strdup(data.artist);
470 properties.metadata.album = g_strdup(data.album);
471 properties.metadata.genres = g_malloc0(sizeof(char *));
472 properties.metadata.genres[0] = g_strdup(data.genre);
473 properties.metadata.tracknumber = data.number;
474 properties.metadata.duration = data.duration;
476 result = _bt_avrcp_set_properties(&properties);
478 g_free((gpointer)properties.metadata.title);
479 g_free((gpointer)properties.metadata.artists);
480 g_free((gpointer)properties.metadata.album);
481 g_free((gpointer)properties.metadata.genres);
485 case BT_AVRCP_SET_PROPERTY: {
489 type = g_array_index(in_param1, int, 0);
490 value = g_array_index(in_param2, unsigned int, 0);
492 result = _bt_avrcp_set_property(type, value);
496 case BT_AVRCP_SET_PROPERTIES: {
497 media_player_settings_t properties;
499 memset(&properties, 0x00, sizeof(media_player_settings_t));
501 properties = g_array_index(in_param1,
502 media_player_settings_t, 0);
504 result = _bt_avrcp_set_properties(&properties);
508 case BT_RFCOMM_CLIENT_CONNECT: {
509 bluetooth_device_address_t address = { {0} };
513 address = g_array_index(in_param1,
514 bluetooth_device_address_t, 0);
516 input_string = &g_array_index(in_param2, char, 0);
518 connect_type = g_array_index(in_param3, int, 0);
520 if (connect_type == BT_RFCOMM_UUID) {
521 result = _bt_rfcomm_connect_using_uuid(request_id,
522 &address, input_string);
524 result = _bt_rfcomm_connect_using_channel(request_id,
525 &address, input_string);
528 if (result != BLUETOOTH_ERROR_NONE) {
529 g_array_append_vals(*out_param1, &address,
530 sizeof(bluetooth_device_address_t));
534 case BT_RFCOMM_CLIENT_CANCEL_CONNECT:
535 result = _bt_rfcomm_cancel_connect();
537 case BT_RFCOMM_CLIENT_IS_CONNECTED: {
538 gboolean connected = FALSE;
539 result = _bt_rfcomm_is_connected(&connected);
541 g_array_append_vals(*out_param1, &connected, sizeof(gboolean));
544 case BT_RFCOMM_SOCKET_DISCONNECT: {
547 socket_fd = g_array_index(in_param1, int, 0);
549 result = _bt_rfcomm_disconnect(socket_fd);
552 case BT_RFCOMM_SOCKET_WRITE: {
557 socket_fd = g_array_index(in_param1, int, 0);
558 length = g_array_index(in_param2, int, 0);
559 buffer = &g_array_index(in_param3, char, 0);
561 result = _bt_rfcomm_write(socket_fd, buffer, length);
564 case BT_RFCOMM_CREATE_SOCKET: {
570 sender = dbus_g_method_get_sender(context);
571 uuid = &g_array_index(in_param1, char, 0);
573 result = _bt_rfcomm_create_socket(sender, uuid);
577 result = BLUETOOTH_ERROR_NONE;
580 g_array_append_vals(*out_param1, &socket_fd, sizeof(int));
585 case BT_RFCOMM_REMOVE_SOCKET: {
588 socket_fd = g_array_index(in_param1, int, 0);
590 result = _bt_rfcomm_remove_socket(socket_fd);
593 case BT_RFCOMM_LISTEN: {
598 socket_fd = g_array_index(in_param1, int, 0);
599 pending = g_array_index(in_param2, int, 0);
600 is_native = g_array_index(in_param3, gboolean, 0);
602 result = _bt_rfcomm_listen(socket_fd, pending, is_native);
605 case BT_RFCOMM_IS_UUID_AVAILABLE: {
606 gboolean available = TRUE;
609 uuid = &g_array_index(in_param1, char, 0);
611 result = _bt_rfcomm_is_uuid_available(uuid, &available);
613 g_array_append_vals(*out_param1, &available, sizeof(gboolean));
616 case BT_RFCOMM_ACCEPT_CONNECTION: {
619 socket_fd = g_array_index(in_param1, int, 0);
621 result = _bt_rfcomm_accept_connection(socket_fd, request_id);
624 case BT_RFCOMM_REJECT_CONNECTION: {
627 socket_fd = g_array_index(in_param1, int, 0);
629 result = _bt_rfcomm_reject_connection(socket_fd);
633 result = BLUETOOTH_ERROR_INTERNAL;
640 static int __bt_obexd_request(int function_name,
643 DBusGMethodInvocation *context,
652 switch (function_name) {
653 case BT_OPP_PUSH_FILES: {
655 bluetooth_device_address_t address = { {0} };
660 address = g_array_index(in_param1,
661 bluetooth_device_address_t, 0);
663 file_count = g_array_index(in_param3, int, 0);
665 file_path = g_new0(char *, file_count + 1);
667 for (i = 0; i < file_count; i++) {
668 path = g_array_index(in_param2,
671 file_path[i] = g_strdup(path.path);
674 result = _bt_opp_client_push_files(request_id, context,
678 for (i = 0; i < file_count; i++) {
679 g_free(file_path[i]);
686 case BT_OPP_CANCEL_PUSH: {
687 result = _bt_opp_client_cancel_push();
691 case BT_OPP_IS_PUSHING_FILES: {
692 gboolean is_sending = FALSE;
694 result = _bt_opp_client_is_sending(&is_sending);
696 g_array_append_vals(*out_param1, &is_sending,
700 case BT_OBEX_SERVER_ALLOCATE: {
706 sender = dbus_g_method_get_sender(context);
707 path = &g_array_index(in_param1, char, 0);
708 is_native = g_array_index(in_param2, gboolean, 0);
709 app_pid = g_array_index(in_param3, int, 0);
711 result = _bt_obex_server_allocate(sender, path, app_pid, is_native);
716 case BT_OBEX_SERVER_DEALLOCATE: {
720 is_native = g_array_index(in_param1, gboolean, 0);
721 app_pid = g_array_index(in_param2, int, 0);
723 result = _bt_obex_server_deallocate(app_pid, is_native);
726 case BT_OBEX_SERVER_IS_ACTIVATED: {
727 gboolean is_activated = FALSE;
729 result = _bt_obex_server_is_activated(&is_activated);
731 g_array_append_vals(*out_param1, &is_activated,
736 case BT_OBEX_SERVER_ACCEPT_CONNECTION: {
737 result = _bt_obex_server_accept_connection(request_id);
741 case BT_OBEX_SERVER_REJECT_CONNECTION: {
742 result = _bt_obex_server_reject_connection();
746 case BT_OBEX_SERVER_ACCEPT_FILE: {
749 file_name = &g_array_index(in_param1, char, 0);
751 result = _bt_obex_server_accept_authorize(file_name, TRUE);
755 case BT_OBEX_SERVER_REJECT_FILE: {
756 result = _bt_obex_server_reject_authorize();
760 case BT_OBEX_SERVER_SET_PATH: {
762 char *destination_path;
764 destination_path = &g_array_index(in_param1, char, 0);
765 is_native = g_array_index(in_param2, gboolean, 0);
767 result = _bt_obex_server_set_destination_path(destination_path,
772 case BT_OBEX_SERVER_SET_ROOT: {
775 root = &g_array_index(in_param1, char, 0);
777 result = _bt_obex_server_set_root(root);
781 case BT_OBEX_SERVER_CANCEL_TRANSFER: {
784 transfer_id = g_array_index(in_param1, int, 0);
786 result = _bt_obex_server_cancel_transfer(transfer_id);
790 case BT_OBEX_SERVER_CANCEL_ALL_TRANSFERS: {
791 result = _bt_obex_server_cancel_all_transfers();
795 case BT_OBEX_SERVER_IS_RECEIVING: {
796 gboolean is_receiving = FALSE;
798 result = _bt_obex_server_is_receiving(&is_receiving);
800 g_array_append_vals(*out_param1, &is_receiving,
805 BT_ERR("Unknown function!");
806 result = BLUETOOTH_ERROR_INTERNAL;
813 gboolean bt_service_request(
816 int service_function,
823 DBusGMethodInvocation *context)
827 GArray *out_param1 = NULL;
828 GArray *out_param2 = NULL;
830 out_param1 = g_array_new(FALSE, FALSE, sizeof(gchar));
831 out_param2 = g_array_new(FALSE, FALSE, sizeof(gchar));
833 if (request_type == BT_ASYNC_REQ
834 || service_function == BT_OBEX_SERVER_ACCEPT_CONNECTION
835 || service_function == BT_RFCOMM_ACCEPT_CONNECTION) {
837 request_id = _bt_assign_request_id();
838 if (request_id < 0) {
839 BT_ERR("Fail to assign the request id");
840 result = BLUETOOTH_ERROR_INTERNAL;
845 switch (service_type) {
846 case BT_BLUEZ_SERVICE:
847 result = __bt_bluez_request(service_function, request_type,
848 request_id, context, in_param1, in_param2,
849 in_param3, in_param4, &out_param1);
851 case BT_OBEX_SERVICE:
852 result = __bt_obexd_request(service_function, request_type,
853 request_id, context, in_param1,
854 in_param2, in_param3,
855 in_param4, &out_param1);
858 BT_ERR("Unknown service type");
859 result = BLUETOOTH_ERROR_INTERNAL;
863 if (result != BLUETOOTH_ERROR_NONE) {
864 BT_ERR("result is not error none: %x", result);
868 g_array_append_vals(out_param2, &result, sizeof(int));
870 if (request_type == BT_ASYNC_REQ
871 || service_function == BT_OBEX_SERVER_ACCEPT_CONNECTION
872 || service_function == BT_RFCOMM_ACCEPT_CONNECTION) {
873 _bt_insert_request_list(request_id, service_function,
877 dbus_g_method_return(context, out_param1, out_param2);
880 g_array_free(out_param1, TRUE);
881 g_array_free(out_param2, TRUE);
885 g_array_append_vals(out_param2, &result, sizeof(int));
886 dbus_g_method_return(context, out_param1, out_param2);
888 g_array_free(out_param1, TRUE);
889 g_array_free(out_param2, TRUE);
891 if (request_type == BT_ASYNC_REQ)
892 _bt_delete_request_id(request_id);
897 int _bt_service_register(void)
899 BtService *bt_service;
900 DBusGConnection *conn;
905 conn = dbus_g_bus_get(DBUS_BUS_SYSTEM, NULL);
906 retv_if(conn == NULL, BLUETOOTH_ERROR_INTERNAL);
908 proxy = dbus_g_proxy_new_for_name(conn, DBUS_SERVICE_DBUS,
909 DBUS_PATH_DBUS, DBUS_INTERFACE_DBUS);
912 BT_ERR("proxy is NULL");
916 if (!dbus_g_proxy_call(proxy, "RequestName", &err, G_TYPE_STRING,
917 BT_SERVICE_NAME, G_TYPE_UINT, 0, G_TYPE_INVALID,
918 G_TYPE_UINT, &result, G_TYPE_INVALID)) {
920 BT_ERR("RequestName RPC failed[%s]\n", err->message);
923 g_object_unref(proxy);
928 g_object_unref(proxy);
930 if (result != DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER) {
931 BT_ERR("Failed to get the primary well-known name.\n");
935 bt_service = g_object_new(BT_SERVICE_TYPE, NULL);
937 dbus_g_connection_register_g_object(conn, BT_SERVICE_PATH,
938 G_OBJECT(bt_service));
940 service_object = bt_service;
941 bt_service_conn = conn;
943 return BLUETOOTH_ERROR_NONE;
946 if (bt_service_conn) {
947 dbus_g_connection_unref(bt_service_conn);
948 bt_service_conn = NULL;
951 return BLUETOOTH_ERROR_INTERNAL;
954 void _bt_service_unregister(void)
956 if (bt_service_conn) {
957 if (service_object) {
958 dbus_g_connection_unregister_g_object(bt_service_conn,
959 G_OBJECT(service_object));
960 g_object_unref(service_object);
961 service_object = NULL;
964 dbus_g_connection_unref(bt_service_conn);
965 bt_service_conn = NULL;