summaryrefslogtreecommitdiff
path: root/android/health.c
diff options
context:
space:
mode:
authorRavi kumar Veeramally <ravikumar.veeramally@linux.intel.com>2014-07-02 12:32:00 +0300
committerSzymon Janc <szymon.janc@tieto.com>2014-07-02 12:18:05 +0200
commitc43eb0ed0a5d957da27cb5f6216e4f9fe045d91f (patch)
tree0120d1144b490f09c134db2ea2551f03e8f8bde9 /android/health.c
parentb4b9893a5fe3486f0f23d3e76180d4028062791e (diff)
downloadbluez-c43eb0ed0a5d957da27cb5f6216e4f9fe045d91f.tar.gz
android/health: Handle incoming streaming data channel request
First data channel should be reliable data channel when remote device in sink role request data channel with option any.
Diffstat (limited to 'android/health.c')
-rw-r--r--android/health.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/android/health.c b/android/health.c
index 1943ced8f..2d80365b3 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)