Skip to contentSkip to conversation

Fix sending AVRCP button released passthrough messages

PATCH In review Scott Talbot 2 participants 2 messages Apr 23, 2009 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix sending AVRCP button released passthrough messages

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(-)
audio/control.c +1 -1
index e0451e7..5cc4a31 100644
@@ -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));
 }
Signature · 1 line
1.6.0.6
#1 lore raw

Hi Scott,

Quoted 11 lines · 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(-)
audio/control.c +0 -0
index e0451e7..5cc4a31 100644

audio/control.c static int avctp_send_passthrough(struct control *control, uint8_t op) · line 943

Quoted 8 lines
audio/control.c +1 -1
@@ -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