2 * Copyright (c) 2010 Samsung Electronics, Inc.
5 * This software is a confidential and proprietary information
6 * of Samsung Electronics, Inc. ("Confidential Information"). You
7 * shall not disclose such Confidential Information and shall use
8 * it only in accordance with the terms of the license agreement
9 * you entered into with Samsung Electronics.
11 #include "setting_control_bt.h"
12 #include "setting_debug.h"
19 GPtrArray *dev_list = NULL;
20 bluetooth_device_info_t *dev;
21 gboolean is_connected = FALSE;
23 dev_list = g_ptr_array_new();
24 if (dev_list == NULL) {
25 printf("Setting - g_ptr_array_new is failed\n");
29 ret = bluetooth_get_bonded_device_list(&dev_list);
30 if (ret != BLUETOOTH_ERROR_NONE) {
31 printf("Setting - bluetooth_get_bonded_device_list is failed 0x%X\n", ret);
32 g_ptr_array_free(dev_list, TRUE);
36 for (i = 0; i < dev_list->len; i++) {
39 dev = g_ptr_array_index(dev_list, i);
41 printf("Setting - Invalid bluetooth device\n");
45 ret = bluetooth_is_device_connected(&dev->device_address,
46 BLUETOOTH_HFG_SERVICE, &is_connected);
47 if (ret == BLUETOOTH_ERROR_NONE && is_connected) {
52 if (dev_list != NULL) {
53 g_ptr_array_foreach(dev_list, (GFunc)g_free, NULL);
54 g_ptr_array_free(dev_list, TRUE);
57 DBG("Setting - connected? %d", is_connected);