linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH BlueZ v1] shared/vcp: Fix notification endianness
@ 2023-12-11 17:11 Luiz Augusto von Dentz
  2023-12-11 18:28 ` [BlueZ,v1] " bluez.test.bot
  2023-12-11 18:40 ` [PATCH BlueZ v1] " patchwork-bot+bluetooth
  0 siblings, 2 replies; 3+ messages in thread
From: Luiz Augusto von Dentz @ 2023-12-11 17:11 UTC (permalink / raw)
  To: linux-bluetooth

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

4db4d5fa1c4f ("shared/vcp: Fix endianness errors") does attempt to fix
the endianness of stored volume offset but in the process it broke the
notification since the value is no longer stored in the Bluetooth byte
order (Little Endian) but instead in the cpu byte order which is then
used in the notification as is, to fix this instead of notifying using
the stored value it now uses a dedicated variable which does use the
value from the request itself.
---
 src/shared/vcp.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/shared/vcp.c b/src/shared/vcp.c
index 5d163266b480..e3451fa2a095 100644
--- a/src/shared/vcp.c
+++ b/src/shared/vcp.c
@@ -683,7 +683,7 @@ static uint8_t vocs_set_vol_offset(struct bt_vocs *vocs, struct bt_vcp *vcp,
 				struct iovec *iov)
 {
 	struct bt_vcp_db *vdb;
-	struct vol_offset_state *vstate;
+	struct vol_offset_state *vstate, state;
 	struct bt_vocs_set_vol_off *req;
 
 	DBG(vcp, "Set Volume Offset");
@@ -720,9 +720,13 @@ static uint8_t vocs_set_vol_offset(struct bt_vocs *vocs, struct bt_vcp *vcp,
 	/* Increment Change Counter */
 	vstate->counter = -~vstate->counter;
 
-	gatt_db_attribute_notify(vdb->vocs->vos, (void *)vstate,
-				 sizeof(struct vol_offset_state),
+	/* Notify change */
+	state.vol_offset = req->set_vol_offset;
+	state.counter = vstate->counter;
+
+	gatt_db_attribute_notify(vdb->vocs->vos, (void *)&state, sizeof(state),
 				 bt_vcp_get_att(vcp));
+
 	return 0;
 }
 
-- 
2.43.0


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

* RE: [BlueZ,v1] shared/vcp: Fix notification endianness
  2023-12-11 17:11 [PATCH BlueZ v1] shared/vcp: Fix notification endianness Luiz Augusto von Dentz
@ 2023-12-11 18:28 ` bluez.test.bot
  2023-12-11 18:40 ` [PATCH BlueZ v1] " patchwork-bot+bluetooth
  1 sibling, 0 replies; 3+ messages in thread
From: bluez.test.bot @ 2023-12-11 18:28 UTC (permalink / raw)
  To: linux-bluetooth, luiz.dentz

[-- Attachment #1: Type: text/plain, Size: 946 bytes --]

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=808878

---Test result---

Test Summary:
CheckPatch                    PASS      0.47 seconds
GitLint                       PASS      0.33 seconds
BuildEll                      PASS      23.84 seconds
BluezMake                     PASS      696.67 seconds
MakeCheck                     PASS      11.47 seconds
MakeDistcheck                 PASS      153.50 seconds
CheckValgrind                 PASS      215.13 seconds
CheckSmatch                   PASS      318.62 seconds
bluezmakeextell               PASS      100.52 seconds
IncrementalBuild              PASS      641.15 seconds
ScanBuild                     PASS      907.11 seconds



---
Regards,
Linux Bluetooth


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

* Re: [PATCH BlueZ v1] shared/vcp: Fix notification endianness
  2023-12-11 17:11 [PATCH BlueZ v1] shared/vcp: Fix notification endianness Luiz Augusto von Dentz
  2023-12-11 18:28 ` [BlueZ,v1] " bluez.test.bot
@ 2023-12-11 18:40 ` patchwork-bot+bluetooth
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+bluetooth @ 2023-12-11 18:40 UTC (permalink / raw)
  To: Luiz Augusto von Dentz; +Cc: linux-bluetooth

Hello:

This patch was applied to bluetooth/bluez.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:

On Mon, 11 Dec 2023 12:11:35 -0500 you wrote:
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> 
> 4db4d5fa1c4f ("shared/vcp: Fix endianness errors") does attempt to fix
> the endianness of stored volume offset but in the process it broke the
> notification since the value is no longer stored in the Bluetooth byte
> order (Little Endian) but instead in the cpu byte order which is then
> used in the notification as is, to fix this instead of notifying using
> the stored value it now uses a dedicated variable which does use the
> value from the request itself.
> 
> [...]

Here is the summary with links:
  - [BlueZ,v1] shared/vcp: Fix notification endianness
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=95838efc07d3

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2023-12-11 18:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-11 17:11 [PATCH BlueZ v1] shared/vcp: Fix notification endianness Luiz Augusto von Dentz
2023-12-11 18:28 ` [BlueZ,v1] " bluez.test.bot
2023-12-11 18:40 ` [PATCH BlueZ v1] " patchwork-bot+bluetooth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).