Linux bluetooth development
 help / color / mirror / Atom feed
From: Michal Labedzki <michal.labedzki@tieto.com>
To: <linux-bluetooth@vger.kernel.org>
Cc: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Subject: Re: [PATCH hcidump 1/2] AVRCP: Add parsing for SetAbsoluteVolume PDU
Date: Tue, 20 Mar 2012 10:15:02 +0100	[thread overview]
Message-ID: <20120320091502.GA6356@uw000554.eu.tieto.com> (raw)
In-Reply-To: <1332178892-8987-1-git-send-email-luiz.dentz@gmail.com>

Hi Luiz,

On Mon, Mar 19, 2012 at 07:41:31PM +0200, Luiz Augusto von Dentz wrote:
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> 
> ---
>  parser/avrcp.c |   20 ++++++++++++++++++++
>  1 files changed, 20 insertions(+), 0 deletions(-)
> 
> diff --git a/parser/avrcp.c b/parser/avrcp.c
> index 643e494..d746937 100644
> --- a/parser/avrcp.c
> +++ b/parser/avrcp.c
> @@ -1201,6 +1201,23 @@ response:
>  	}
>  }
>  
> +static void avrcp_set_absolut_volume_dump(int level, struct frame *frm,
> +						uint8_t ctype, uint16_t len)

Typo? "absolut" --> "absolute"

> +{
> +	uint8_t value;
> +
> +	p_indent(level, frm);
> +
> +	if (len < 1) {
> +		printf("PDU Malformed\n");
> +		raw_dump(level, frm);
> +		return;
> +	}
> +
> +	value = get_u8(frm);

"value" is only lower seven bits. You should use mask 0x80. 
The same for Patch 2/2.

> +	printf("Value: 0x%02x\n", value);

"Value"? "Volume" seems to be better, and why hex value? I propose 
decimal and percent value, for example: "Volume: 38% (48/127)"


> +}
> +
>  static void avrcp_pdu_dump(int level, struct frame *frm, uint8_t ctype)
>  {
>  	uint8_t pduid, pt;
> @@ -1267,6 +1284,9 @@ static void avrcp_pdu_dump(int level, struct frame *frm, uint8_t ctype)
>  	case AVRCP_REGISTER_NOTIFICATION:
>  		avrcp_register_notification_dump(level + 1, frm, ctype, len);
>  		break;
> +	case AVRCP_SET_ABSOLUTE_VOLUME:
> +		avrcp_set_absolut_volume_dump(level + 1, frm, ctype, len);
> +		break;
>  	default:
>  		raw_dump(level, frm);
>  	}
> -- 
> 1.7.7.6
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
Regards
Michal Labedzki

  parent reply	other threads:[~2012-03-20  9:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-19 17:41 [PATCH hcidump 1/2] AVRCP: Add parsing for SetAbsoluteVolume PDU Luiz Augusto von Dentz
2012-03-19 17:41 ` [PATCH hcidump 2/2] AVRCP: Add parsing support for Volume Change notification Luiz Augusto von Dentz
2012-03-22  1:22   ` Lucas De Marchi
2012-03-20  9:15 ` Michal Labedzki [this message]
2012-03-20 11:22   ` [PATCH hcidump 1/2] AVRCP: Add parsing for SetAbsoluteVolume PDU Luiz Augusto von Dentz

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=20120320091502.GA6356@uw000554.eu.tieto.com \
    --to=michal.labedzki@tieto.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=luiz.dentz@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox