X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=bt-api%2Fbt-audio.c;h=1b124147a03d116e122124ca133b77cd5f288425;hb=1fa07edcd0e77a445700975773db3300f556caf5;hp=dd7eef7c5718230899bba4f4020f98bb0f822f47;hpb=f3bb85ce124d84934179652a3da4b445ce136523;p=platform%2Fcore%2Fconnectivity%2Fbluetooth-frwk.git diff --git a/bt-api/bt-audio.c b/bt-api/bt-audio.c index dd7eef7..1b12414 100644 --- a/bt-api/bt-audio.c +++ b/bt-api/bt-audio.c @@ -128,6 +128,7 @@ BT_EXPORT_API int bluetooth_audio_connect(bluetooth_device_address_t *remote_add g_array_append_vals(in_param1, remote_address, sizeof(bluetooth_device_address_t)); +#ifdef TIZEN_FEATURE_BT_DPM if (service_function == BT_AV_CONNECT) result = _bt_send_request_async(BT_BLUEZ_SERVICE, BT_AV_CONNECT, in_param1, in_param2, in_param3, in_param4, @@ -137,6 +138,7 @@ BT_EXPORT_API int bluetooth_audio_connect(bluetooth_device_address_t *remote_add in_param1, in_param2, in_param3, in_param4, user_info->cb, user_info->user_data); else /* default case - with or without DPM enabled */ +#endif result = _bt_send_request_async(BT_BLUEZ_SERVICE, BT_AUDIO_CONNECT, in_param1, in_param2, in_param3, in_param4, user_info->cb, user_info->user_data); @@ -256,6 +258,7 @@ BT_EXPORT_API int bluetooth_ag_disconnect(bluetooth_device_address_t *remote_add g_array_append_vals(in_param1, remote_address, sizeof(bluetooth_device_address_t)); + BT_INFO_C("### Disconnect AG"); result = _bt_send_request_async(BT_BLUEZ_SERVICE, BT_AG_DISCONNECT, in_param1, in_param2, in_param3, in_param4, user_info->cb, user_info->user_data); @@ -312,6 +315,7 @@ BT_EXPORT_API int bluetooth_av_connect(bluetooth_device_address_t *remote_addres g_array_append_vals(in_param1, remote_address, sizeof(bluetooth_device_address_t)); + BT_INFO_C("### Connect AV"); result = _bt_send_request_async(BT_BLUEZ_SERVICE, BT_AV_CONNECT, in_param1, in_param2, in_param3, in_param4, user_info->cb, user_info->user_data); @@ -355,6 +359,7 @@ BT_EXPORT_API int bluetooth_av_source_connect(bluetooth_device_address_t *remote g_array_append_vals(in_param1, remote_address, sizeof(bluetooth_device_address_t)); + BT_INFO_C("### Connect AV Source"); result = _bt_send_request_async(BT_BLUEZ_SERVICE, BT_AV_SOURCE_CONNECT, in_param1, in_param2, in_param3, in_param4, user_info->cb, user_info->user_data); @@ -386,6 +391,7 @@ BT_EXPORT_API int bluetooth_av_disconnect(bluetooth_device_address_t *remote_add g_array_append_vals(in_param1, remote_address, sizeof(bluetooth_device_address_t)); + BT_INFO_C("### Disconnect AV"); result = _bt_send_request_async(BT_BLUEZ_SERVICE, BT_AV_DISCONNECT, in_param1, in_param2, in_param3, in_param4, user_info->cb, user_info->user_data); @@ -417,6 +423,7 @@ BT_EXPORT_API int bluetooth_av_source_disconnect(bluetooth_device_address_t *rem g_array_append_vals(in_param1, remote_address, sizeof(bluetooth_device_address_t)); + BT_INFO_C("### Disconnect AV Source"); result = _bt_send_request_async(BT_BLUEZ_SERVICE, BT_AV_SOURCE_DISCONNECT, in_param1, in_param2, in_param3, in_param4, user_info->cb, user_info->user_data); @@ -505,10 +512,10 @@ static GVariant* __bt_hf_agent_dbus_send(const char *path, const char *interface GDBusProxy *proxy = NULL; GDBusConnection *conn = NULL; - conn = _bt_gdbus_get_system_gconn(); + conn = _bt_get_system_private_conn(); retv_if(conn == NULL, NULL); - proxy = g_dbus_proxy_new_sync(conn, G_DBUS_PROXY_FLAGS_NONE, + proxy = g_dbus_proxy_new_sync(conn, G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES, NULL, BT_HF_SERVICE_NAME, path, interface, NULL, err); if (proxy == NULL) { BT_ERR("Unable to allocate new proxy"); @@ -674,6 +681,7 @@ BT_EXPORT_API int bluetooth_hf_disconnect(bluetooth_device_address_t *remote_add g_array_append_vals(in_param1, remote_address, sizeof(bluetooth_device_address_t)); + BT_INFO_C("### Disconnect HF"); result = _bt_send_request_async(BT_BLUEZ_SERVICE, BT_HF_DISCONNECT, in_param1, in_param2, in_param3, in_param4, user_info->cb, user_info->user_data); @@ -1081,6 +1089,33 @@ BT_EXPORT_API int bluetooth_hf_request_call_list( return BLUETOOTH_ERROR_NONE; } +BT_EXPORT_API int bluetooth_hf_request_call_list_async(void) +{ + GVariant *reply = NULL; + GError *err = NULL; + int ret = BLUETOOTH_ERROR_INTERNAL; + + BT_CHECK_ENABLED(return); + + reply = __bt_hf_agent_dbus_send(BT_HF_OBJECT_PATH, BT_HF_INTERFACE, + "RequestCallListAsync", &err, NULL); + if (!reply) { + BT_ERR("Error returned in method call\n"); + if (err) { + BT_ERR("Error = %s", err->message); + if (strstr(err->message, "No data")) + ret = BLUETOOTH_ERROR_NO_DATA; + else if (strstr(err->message, "NotConnected")) + ret = BLUETOOTH_ERROR_NOT_CONNECTED; + g_clear_error(&err); + } + return ret; + } + + g_variant_unref(reply); + return BLUETOOTH_ERROR_NONE; +} + BT_EXPORT_API int bluetooth_hf_get_codec(unsigned int *codec_id) { GVariant *reply = NULL;