summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAyush Garg <ayush.garg@samsung.com>2022-09-14 10:18:52 +0530
committerAyush Garg <ayush.garg@samsung.com>2022-09-15 11:57:03 +0530
commit6e34ecb6e1994bc63e476648e0d7f4a3a4333f11 (patch)
treeb0633187a328dc032b6f8713b373348b230cd26e
parent286943d0bffa956442a1df56e133a37ee15796d7 (diff)
downloadbluez-6e34ecb6e1994bc63e476648e0d7f4a3a4333f11.tar.gz
bluez-6e34ecb6e1994bc63e476648e0d7f4a3a4333f11.tar.bz2
bluez-6e34ecb6e1994bc63e476648e0d7f4a3a4333f11.zip
fhub: diallaow A2DP multistream and change avrcp version
Change-Id: I4f89fe9e46689fc7854b2f7313aca46f41226bc3 Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
-rwxr-xr-xplugins/policy.c24
-rw-r--r--profiles/audio/avdtp.c21
-rw-r--r--profiles/audio/avrcp.c21
3 files changed, 51 insertions, 15 deletions
diff --git a/plugins/policy.c b/plugins/policy.c
index 1187e897..46bbb85f 100755
--- a/plugins/policy.c
+++ b/plugins/policy.c
@@ -34,6 +34,10 @@
#include "src/shared/timeout.h"
#ifdef TIZEN_FEATURE_BLUEZ_MODIFY
+#include "../profile.h"
+#endif
+
+#ifdef TIZEN_FEATURE_BLUEZ_MODIFY
#define CONTROL_CONNECT_TIMEOUT 4
#define TARGET_CONNECT_TIMEOUT 1
#else
@@ -70,6 +74,12 @@ static const char *default_reconnect[] = {
HSP_AG_UUID, HFP_AG_UUID, A2DP_SOURCE_UUID
A2DP_SINK_UUID, NULL };
#endif
+#ifdef TIZEN_FEATURE_BLUEZ_MODIFY
+static const char *fhub_default_reconnect[] = {
+ HSP_AG_UUID, HFP_AG_UUID, A2DP_SOURCE_UUID
+ A2DP_SINK_UUID, NULL };
+#endif
+
static char **reconnect_uuids = NULL;
static const size_t default_attempts = 7;
@@ -897,7 +907,12 @@ static int policy_init(void)
conf = btd_get_main_conf();
if (!conf) {
- reconnect_uuids = g_strdupv((char **) default_reconnect);
+#ifdef TIZEN_FEATURE_BLUEZ_MODIFY
+ if (TIZEN_FEATURE_BLUEZ_FHUB)
+ reconnect_uuids = g_strdupv((char **) fhub_default_reconnect);
+ else
+#endif
+ reconnect_uuids = g_strdupv((char **) default_reconnect);
reconnect_attempts = default_attempts;
reconnect_intervals_len = sizeof(default_intervals) /
sizeof(*reconnect_intervals);
@@ -913,7 +928,12 @@ static int policy_init(void)
NULL, &gerr);
if (gerr) {
g_clear_error(&gerr);
- reconnect_uuids = g_strdupv((char **) default_reconnect);
+#ifdef TIZEN_FEATURE_BLUEZ_MODIFY
+ if (TIZEN_FEATURE_BLUEZ_FHUB)
+ reconnect_uuids = g_strdupv((char **) fhub_default_reconnect);
+ else
+#endif
+ reconnect_uuids = g_strdupv((char **) default_reconnect);
}
reconnect_attempts = g_key_file_get_integer(conf, "Policy",
diff --git a/profiles/audio/avdtp.c b/profiles/audio/avdtp.c
index ae96dfd9..30e3d0b3 100644
--- a/profiles/audio/avdtp.c
+++ b/profiles/audio/avdtp.c
@@ -1409,8 +1409,10 @@ static void release_stream(struct avdtp_stream *stream, struct avdtp *session)
struct avdtp_local_sep *sep = stream->lsep;
#if defined(TIZEN_FEATURE_BLUEZ_MODIFY) && defined(TIZEN_FEATURE_BLUEZ_A2DP_MULTISTREAM)
- /* Connection lost */
- avdtp_remove_source_devce(session->device);
+ if (!TIZEN_FEATURE_BLUEZ_FHUB) {
+ /* Connection lost */
+ avdtp_remove_source_devce(session->device);
+ }
#endif
if (sep->cfm && sep->cfm->abort &&
@@ -2267,7 +2269,8 @@ static gboolean avdtp_start_cmd(struct avdtp *session, uint8_t transaction,
avdtp_check_collision(session, AVDTP_START, stream);
#if defined(TIZEN_FEATURE_BLUEZ_MODIFY) && defined(TIZEN_FEATURE_BLUEZ_A2DP_MULTISTREAM)
- avdtp_add_source_device(session->device);
+ if (!TIZEN_FEATURE_BLUEZ_FHUB)
+ avdtp_add_source_device(session->device);
#endif
avdtp_sep_set_state(session, sep, AVDTP_STATE_STREAMING);
@@ -2293,7 +2296,8 @@ static gboolean avdtp_close_cmd(struct avdtp *session, uint8_t transaction,
uint8_t err;
#if defined(TIZEN_FEATURE_BLUEZ_MODIFY) && defined(TIZEN_FEATURE_BLUEZ_A2DP_MULTISTREAM)
- avdtp_remove_source_devce(session->device);
+ if (!TIZEN_FEATURE_BLUEZ_FHUB)
+ avdtp_remove_source_devce(session->device);
#endif
if (size < sizeof(struct seid_req)) {
@@ -2375,8 +2379,13 @@ static gboolean avdtp_suspend_cmd(struct avdtp *session, uint8_t transaction,
#if defined(TIZEN_FEATURE_BLUEZ_MODIFY) && defined(TIZEN_FEATURE_BLUEZ_A2DP_MULTISTREAM)
if (sep->state != AVDTP_STATE_STREAMING) {
DBG("Not streaming state: %d", sep->state);
- return avdtp_send(session, transaction, AVDTP_MSG_TYPE_ACCEPT,
- AVDTP_SUSPEND, NULL, 0);
+ if (!TIZEN_FEATURE_BLUEZ_FHUB) {
+ return avdtp_send(session, transaction, AVDTP_MSG_TYPE_ACCEPT,
+ AVDTP_SUSPEND, NULL, 0);
+ } else {
+ err = AVDTP_BAD_STATE;
+ goto failed;
+ }
}
#else
if (sep->state != AVDTP_STATE_STREAMING) {
diff --git a/profiles/audio/avrcp.c b/profiles/audio/avrcp.c
index 31c0e2c9..387b1a06 100644
--- a/profiles/audio/avrcp.c
+++ b/profiles/audio/avrcp.c
@@ -133,6 +133,7 @@
#ifdef TIZEN_FEATURE_BLUEZ_MODIFY
#define AVRCP_CT_VERSION 0x0104
#define AVRCP_TG_VERSION 0x0103
+#define FHUB_AVRCP_CT_VERSION 0x0103
#else
#define AVRCP_CT_VERSION 0x0106
#define AVRCP_TG_VERSION 0x0105
@@ -430,6 +431,7 @@ static sdp_record_t *avrcp_ct_record(bool browsing)
sdp_data_t *psm[2], *version, *features;
uint16_t lp = AVCTP_CONTROL_PSM;
#ifdef TIZEN_FEATURE_BLUEZ_MODIFY
+ uint16_t avrcp_ct_ver;
uint16_t avctp_ver = 0x0104;
uint16_t feat = 0;
#ifdef ENABLE_AVRCP_CATEGORY1
@@ -485,9 +487,12 @@ static sdp_record_t *avrcp_ct_record(bool browsing)
/* Bluetooth Profile Descriptor List */
sdp_uuid16_create(&profile[0].uuid, AV_REMOTE_PROFILE_ID);
- profile[0].version = AVRCP_CT_VERSION;
#ifdef TIZEN_FEATURE_BLUEZ_MODIFY
- adapter_avrcp_ct_ver = AVRCP_CT_VERSION;
+ avrcp_ct_ver = TIZEN_FEATURE_BLUEZ_FHUB ? FHUB_AVRCP_CT_VERSION : AVRCP_CT_VERSION;
+ profile[0].version = avrcp_ct_ver;
+ adapter_avrcp_ct_ver = avrcp_ct_ver;
+#else
+ profile[0].version = AVRCP_CT_VERSION;
#endif
pfseq = sdp_list_append(NULL, &profile[0]);
sdp_set_profile_descs(record, pfseq);
@@ -4158,12 +4163,14 @@ static void avrcp_status_changed(struct avrcp *session,
strval = status_to_string(value);
#if defined(TIZEN_FEATURE_BLUEZ_MODIFY) && defined(TIZEN_FEATURE_BLUEZ_A2DP_MULTISTREAM)
- DBG("AVRCP status changed to : %s", strval);
+ if (!TIZEN_FEATURE_BLUEZ_FHUB) {
+ DBG("AVRCP status changed to : %s", strval);
- if (value == AVRCP_PLAY_STATUS_PAUSED)
- media_transport_set_stream_status(session->dev, true);
- else if ( value == AVRCP_PLAY_STATUS_PLAYING)
- media_transport_set_stream_status(session->dev, false);
+ if (value == AVRCP_PLAY_STATUS_PAUSED)
+ media_transport_set_stream_status(session->dev, true);
+ else if ( value == AVRCP_PLAY_STATUS_PLAYING)
+ media_transport_set_stream_status(session->dev, false);
+ }
#endif
if (g_strcmp0(curval, strval) == 0)