Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH BlueZ 1/3] shared/vcp: Notify Volume State on Mute
@ 2026-11-24 14:35 Simon Mikuda
  2026-11-24 14:36 ` [PATCH BlueZ 2/3] shared/vcp: Keep Change_Counter on operations that change nothing Simon Mikuda
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Simon Mikuda @ 2026-11-24 14:35 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Simon Mikuda

A Mute operation on the Volume Control Point sets Mute and increments
Change_Counter, but unlike every other operation it does not notify
Volume State. A client that keeps Change_Counter from the notifications
then writes its next operation with a stale value and gets Invalid
Change Counter.

Fixes: b8a113ecbabc ("shared/vcp: Add initial code for handling VCP")
Assisted-by: Claude:claude-opus-5-5
---
 src/shared/vcp.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/shared/vcp.c b/src/shared/vcp.c
index c7f74956e..d19bd9210 100644
--- a/src/shared/vcp.c
+++ b/src/shared/vcp.c
@@ -861,6 +861,9 @@ static uint8_t vcs_mute(struct bt_vcs *vcs, struct bt_vcp *vcp,
 	vstate->mute = 0x01;
 	vstate->counter = -~vstate->counter; /*Increment Change Counter*/
 
+	gatt_db_attribute_notify(vdb->vcs->vs, (void *)vstate,
+				 sizeof(struct vol_state),
+				 bt_vcp_get_att(vcp));
 	return 0;
 }
 

base-commit: 1608f836188610aabeff5a3164169ebe0360e443
-- 
2.43.0


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

end of thread, other threads:[~2026-11-24 20:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-24 14:35 [PATCH BlueZ 1/3] shared/vcp: Notify Volume State on Mute Simon Mikuda
2026-11-24 14:36 ` [PATCH BlueZ 2/3] shared/vcp: Keep Change_Counter on operations that change nothing Simon Mikuda
2026-11-24 14:36 ` [PATCH BlueZ 3/3] unit/test-vcp: Add tests for Volume State changes Simon Mikuda
2026-11-24 20:43 ` [BlueZ,1/3] shared/vcp: Notify Volume State on Mute bluez.test.bot

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