public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix sending AVRCP button released passthrough messages
@ 2009-04-23 11:53 Scott Talbot
  2009-04-23 12:42 ` Johan Hedberg
  0 siblings, 1 reply; 2+ messages in thread
From: Scott Talbot @ 2009-04-23 11:53 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Scott Talbot

Set the high bit in the op value for the button released event rather
than clearing the entire field.
---
 audio/control.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/audio/control.c b/audio/control.c
index e0451e7..5cc4a31 100644
--- a/audio/control.c
+++ b/audio/control.c
@@ -937,7 +937,7 @@ static int avctp_send_passthrough(struct control *control, uint8_t op)
 
 	/* Button release */
 	avctp->transaction = transaction++;
-	operands[0] &= 0x80;
+	operands[0] |= 0x80;
 
 	return write(sk, buf, sizeof(buf));
 }
-- 
1.6.0.6


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

* Re: [PATCH] Fix sending AVRCP button released passthrough messages
  2009-04-23 11:53 [PATCH] Fix sending AVRCP button released passthrough messages Scott Talbot
@ 2009-04-23 12:42 ` Johan Hedberg
  0 siblings, 0 replies; 2+ messages in thread
From: Johan Hedberg @ 2009-04-23 12:42 UTC (permalink / raw)
  To: Scott Talbot; +Cc: linux-bluetooth

Hi Scott,

On Thu, Apr 23, 2009, Scott Talbot wrote:
>Set the high bit in the op value for the button released event rather
>than clearing the entire field.
>---
> audio/control.c |    2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
>diff --git a/audio/control.c b/audio/control.c
>index e0451e7..5cc4a31 100644
>--- a/audio/control.c
>+++ b/audio/control.c
>@@ -937,7 +937,7 @@ static int avctp_send_passthrough(struct control *control, uint8_t op)
> 
> 	/* Button release */
> 	avctp->transaction = transaction++;
>-	operands[0] &= 0x80;
>+	operands[0] |= 0x80;
> 
> 	return write(sk, buf, sizeof(buf));
> }

Yeah, stupid mistake by me (though headsets I tested with didn't seem to 
mind this). Thanks for catching it! The patch is now pushed upstream.

Johan


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

end of thread, other threads:[~2009-04-23 12:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-23 11:53 [PATCH] Fix sending AVRCP button released passthrough messages Scott Talbot
2009-04-23 12:42 ` Johan Hedberg

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