All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
To: Szymon Janc <szymon.janc@tieto.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH_v2 2/4] anrdoid/health: Fix wrong channel type defines
Date: Tue, 17 Jun 2014 13:03:05 +0300	[thread overview]
Message-ID: <53A01259.7000909@linux.intel.com> (raw)
In-Reply-To: <1976668.iXxFPmJhy5@uw000953>

Hi Szymon,

On 06/17/2014 12:29 PM, Szymon Janc wrote:
> Hi Ravi,
>
> On Tuesday 17 of June 2014 01:02:48 Ravi kumar Veeramally wrote:
>> Enums in bt_hl.h are defined in this order BTHL_CHANNEL_TYPE_RELIABLE,
>> BTHL_CHANNEL_TYPE_STREAMING, BTHL_CHANNEL_TYPE_ANY. But HDP_SPEC_V11(3.4)
>> has no-preference(any)-0, reliable-1, stream-2, reserved(0x03-0xff).
>> Providing utility to solve this.
>> ---
>>   android/health.c | 18 +++++++++++++++++-
>>   1 file changed, 17 insertions(+), 1 deletion(-)
>>
>> diff --git a/android/health.c b/android/health.c
>> index 7e2c5d6..5a87089 100644
>> --- a/android/health.c
>> +++ b/android/health.c
>> @@ -52,6 +52,10 @@
>>   #define HDP_VERSION			0x0101
>>   #define DATA_EXCHANGE_SPEC_11073	0x01
>>   
>> +#define CHANNEL_TYPE_ANY       0x00
>> +#define CHANNEL_TYPE_RELIABLE  0x01
>> +#define CHANNEL_TYPE_STREAM    0x02
>> +
> Isn't that already defined in hdp_types.h ?
   Android is not using hdp_types.h .
>>   static bdaddr_t adapter_addr;
>>   static struct ipc *hal_ipc = NULL;
>>   static struct queue *apps = NULL;
>> @@ -639,6 +643,18 @@ fail:
>>   							HAL_STATUS_FAILED);
>>   }
>>   
>> +static uint8_t android2channel_type(uint8_t type)
>> +{
>> +	switch (type) {
>> +	case HAL_HEALTH_CHANNEL_TYPE_RELIABLE:
>> +		return CHANNEL_TYPE_RELIABLE;
>> +	case HAL_HEALTH_CHANNEL_TYPE_STREAMING:
>> +		return CHANNEL_TYPE_STREAM;
>> +	}
>> +
>> +	return CHANNEL_TYPE_ANY;
> Move this under default case.
   Ok.
>> +}
>> +
>>   static void bt_health_mdep_cfg_data(const void *buf, uint16_t len)
>>   {
>>   	const struct hal_cmd_health_mdep *cmd = buf;
>> @@ -662,7 +678,7 @@ static void bt_health_mdep_cfg_data(const void *buf, uint16_t len)
>>   
>>   	mdep->role = cmd->role;
>>   	mdep->data_type = cmd->data_type;
>> -	mdep->channel_type = cmd->channel_type;
>> +	mdep->channel_type = android2channel_type(cmd->channel_type);
>>   	mdep->id = queue_length(app->mdeps) + 1;
>>   
>>   	if (cmd->descr_len > 0) {
>>
Thanks,
Ravi.

  reply	other threads:[~2014-06-17 10:03 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-16 22:02 [PATCH_v2 0/4] Intiates L2CAP Control Channel Ravi kumar Veeramally
2014-06-16 22:02 ` [PATCH_v2 1/4] profiles/health/hdp: Fix memory leak in SDP record preparati Sdp record preparation part is copied to android/health.c from profiles/health/hdp_utils.c. Memory leak is noticed while testing. Memory summay is from android daemon, but code snippet is same. It is already fixed in android/health.c while submitting android related patches Ravi kumar Veeramally
2014-06-17  9:29   ` Szymon Janc
2014-06-17  9:59     ` Ravi kumar Veeramally
2014-06-16 22:02 ` [PATCH_v2 2/4] anrdoid/health: Fix wrong channel type defines Ravi kumar Veeramally
2014-06-17  9:29   ` Szymon Janc
2014-06-17 10:03     ` Ravi kumar Veeramally [this message]
2014-06-16 22:02 ` [PATCH_v2 3/4] android/health: Initial connect channel implementation Ravi kumar Veeramally
2014-06-17 10:16   ` Szymon Janc
2014-06-17 10:48     ` Ravi kumar Veeramally
2014-06-16 22:02 ` [PATCH_v2 4/4] android/health: Notify channel connection status Ravi kumar Veeramally

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53A01259.7000909@linux.intel.com \
    --to=ravikumar.veeramally@linux.intel.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=szymon.janc@tieto.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.