Linux bluetooth development
 help / color / mirror / Atom feed
From: Szymon Janc <szymon.janc@tieto.com>
To: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH 1/2] android/hal-health: Fix not setting offsets for empty strings
Date: Mon, 16 Jun 2014 16:05:14 +0200	[thread overview]
Message-ID: <5973276.61DRCaSDdV@uw000953> (raw)
In-Reply-To: <1402925256-9096-1-git-send-email-szymon.janc@tieto.com>

On Monday 16 of June 2014 15:27:35 Szymon Janc wrote:
> In register_app command all strings except app name are optional.
> Those are passed over IPC concatenated and offsets are used to
> determine string presence and length.
> ---
>  android/hal-health.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/android/hal-health.c b/android/hal-health.c
> index 012b6b7..ab06658 100644
> --- a/android/hal-health.c
> +++ b/android/hal-health.c
> @@ -93,23 +93,23 @@ static bt_status_t register_application(bthl_reg_param_t *reg, int *app_id)
>  	memcpy(cmd->data, reg->application_name, len);
>  	off += len;
>  
> +	cmd->provider_name_off = off;
>  	if (reg->provider_name) {
>  		len = strlen(reg->provider_name) + 1;
> -		cmd->provider_name_off = off;
>  		memcpy(cmd->data + off, reg->provider_name, len);
>  		off += len;
>  	}
>  
> +	cmd->service_name_off = off;
>  	if (reg->srv_name) {
>  		len = strlen(reg->srv_name) + 1;
> -		cmd->service_name_off = off;
>  		memcpy(cmd->data + off, reg->srv_name, len);
>  		off += len;
>  	}
>  
> +	cmd->service_descr_off = off;
>  	if (reg->srv_desp) {
>  		len = strlen(reg->srv_desp) + 1;
> -		cmd->service_descr_off = off;
>  		memcpy(cmd->data + off, reg->srv_desp, len);
>  		off += len;
>  	}
> 

Applied.

-- 
Best regards, 
Szymon Janc

      parent reply	other threads:[~2014-06-16 14:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-16 13:27 [PATCH 1/2] android/hal-health: Fix not setting offsets for empty strings Szymon Janc
2014-06-16 13:27 ` [PATCH 2/2] android/health: Verify register_app command correctness Szymon Janc
2014-06-16 14:05 ` Szymon Janc [this message]

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=5973276.61DRCaSDdV@uw000953 \
    --to=szymon.janc@tieto.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox