#include "bt-service-headset-connection.h"
#ifdef TIZEN_SUPPORT_DUAL_HF
+#ifdef TIZEN_PROFILE_WEARABLE
#define VCONF_KEY_BT_HOST_BT_MAC_ADDR "db/wms/host_bt_mac"
#endif
+#endif
typedef struct {
unsigned int type;
#ifdef TIZEN_SUPPORT_DUAL_HF
gboolean __bt_is_companion_device(const char *addr)
{
- if (TIZEN_PROFILE_WEARABLE) {
- char *host_device_address = NULL;
- host_device_address = vconf_get_str(VCONF_KEY_BT_HOST_BT_MAC_ADDR);
-
- if (!host_device_address) {
- BT_INFO("Failed to get a companion device address");
- return FALSE;
- }
+#ifdef TIZEN_PROFILE_WEARABLE
+ char *host_device_address = NULL;
+ host_device_address = vconf_get_str(VCONF_KEY_BT_HOST_BT_MAC_ADDR);
- if (g_strcmp0(host_device_address, addr) == 0) {
- BT_INFO("Found companion device");
- free(host_device_address);
- return TRUE;
- }
+ if (!host_device_address) {
+ BT_INFO("Failed to get a companion device address");
+ return FALSE;
+ }
+ if (g_strcmp0(host_device_address, addr) == 0) {
+ BT_INFO("Found companion device");
free(host_device_address);
- return FALSE;
- } else {
- /* TODO : Need to add companion device check condition for Phone models */
- return FALSE;
+ return TRUE;
}
+
+ free(host_device_address);
+ return FALSE;
+#else
+ /* TODO : Need to add companion device check condition for Phone models */
+ return FALSE;
+#endif
}
#endif
return BLUETOOTH_ERROR_NOT_CONNECTED;
#endif
- /* Convert BD adress from string type */
+ /* Convert BD address from string type */
_bt_convert_addr_string_to_type(device_address.addr, connected_address);
int value = BLUETOOTH_ERROR_NONE;
value = _bt_audio_disconnect(0, connected_device->type & type, &device_address, NULL);
}
connected_device = g_malloc0(sizeof(bt_connected_headset_data_t));
+
connected_device->device_state = status;
if ((status == BT_STATE_CONNECTED) || (status == BT_STATE_CONNECTING))
connected_device->type |= type;
int size;
int i;
int j;
- bluetooth_device_info_t info;
+ bluetooth_device_info_t *info;
char bond_address[BT_ADDRESS_STRING_SIZE] = { 0 };
gboolean ret = FALSE;
size = (dev_list->len) / sizeof(bluetooth_device_info_t);
for (i = 0; i < size; i++) {
- info = g_array_index(dev_list, bluetooth_device_info_t, i);
+ info = &g_array_index(dev_list, bluetooth_device_info_t, i);
_bt_convert_addr_type_to_string(bond_address,
- info.device_address.addr);
+ info->device_address.addr);
if (strcmp(bond_address, remote_address) != 0)
continue;
BT_INFO("Device address Matched");
j = 0;
- while (j != info.service_index) {
+ while (j != info->service_index) {
if (type == BT_AUDIO_HSP) {
- if (strcmp(info.uuids[j], HFP_HS_UUID) == 0) {
+ if (strcmp(info->uuids[j], HFP_HS_UUID) == 0) {
BT_INFO("HFP HS UUID exists");
ret = TRUE;
goto end;
}
} else if (type == BT_AUDIO_A2DP) {
- if (strcmp(info.uuids[j], A2DP_SINK_UUID) == 0) {
+ if (strcmp(info->uuids[j], A2DP_SINK_UUID) == 0) {
BT_INFO("A2DP SINK UUID exists");
ret = TRUE;
goto end;
_bt_convert_addr_type_to_string(address, device_address->addr);
func_data = g_malloc0(sizeof(bt_audio_function_data_t));
+
func_data->address = g_strdup(address);
func_data->req_id = request_id;
func_data->type = type;