public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] android/health: Handle incoming streaming data channel request
@ 2014-07-02  9:32 Ravi kumar Veeramally
  2014-07-02  9:32 ` [PATCH 2/3] android/client/health: Change multi dimension array to struct mode Ravi kumar Veeramally
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Ravi kumar Veeramally @ 2014-07-02  9:32 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Ravi kumar Veeramally

First data channel should be reliable data channel when remote device
in sink role request data channel with option any.
---
 android/health.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/android/health.c b/android/health.c
index 1943ced..2d80365 100644
--- a/android/health.c
+++ b/android/health.c
@@ -1423,7 +1423,8 @@ static uint8_t mcap_mdl_conn_req_cb(struct mcap_mcl *mcl, uint8_t mdepid,
 	struct health_app *app;
 	struct mdep_cfg *mdep;
 
-	DBG("Data channel request: mdepid %u mdlid %u", mdepid, mdlid);
+	DBG("Data channel request: mdepid %u mdlid %u conf %u",
+							mdepid, mdlid, *conf);
 
 	if (mdepid == MDEP_ECHO)
 		/* For echo service take last app */
@@ -1478,10 +1479,14 @@ static uint8_t mcap_mdl_conn_req_cb(struct mcap_mcl *mcl, uint8_t mdepid,
 
 	switch (*conf) {
 	case CHANNEL_TYPE_ANY:
-		if (mdep->role == HAL_HEALTH_MDEP_ROLE_SINK)
+		if (mdep->role == HAL_HEALTH_MDEP_ROLE_SINK) {
 			return MCAP_CONFIGURATION_REJECTED;
-		else
-			*conf = CHANNEL_TYPE_RELIABLE;
+		} else {
+			if (queue_length(channel->dev->channels) <= 1)
+				*conf = CHANNEL_TYPE_RELIABLE;
+			else
+				*conf = CHANNEL_TYPE_STREAM;
+		}
 		break;
 	case CHANNEL_TYPE_STREAM:
 		if (mdep->role == HAL_HEALTH_MDEP_ROLE_SOURCE)
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-07-02 10:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-02  9:32 [PATCH 1/3] android/health: Handle incoming streaming data channel request Ravi kumar Veeramally
2014-07-02  9:32 ` [PATCH 2/3] android/client/health: Change multi dimension array to struct mode Ravi kumar Veeramally
2014-07-02  9:32 ` [PATCH 3/3] android/health: Update PTS result for TC_SRC_CC_BV_09_C Ravi kumar Veeramally
2014-07-02 10:26 ` [PATCH 1/3] android/health: Handle incoming streaming data channel request Szymon Janc

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox