From a875aa40559a6b150c52821e4fe74bb1f0ee59a8 Mon Sep 17 00:00:00 2001 From: Josh Wu Date: Wed, 21 May 2025 00:08:43 +0800 Subject: [PATCH] Fix wrong remove_data_path arguments --- bumble/device.py | 6 ++++-- bumble/profiles/ascs.py | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/bumble/device.py b/bumble/device.py index a33661de..f92271d7 100644 --- a/bumble/device.py +++ b/bumble/device.py @@ -1464,7 +1464,7 @@ class _IsoLink: check_result=True, ) - async def remove_data_path(self, direction: _IsoLink.Direction) -> int: + async def remove_data_path(self, directions: Iterable[_IsoLink.Direction]) -> int: """Remove a data path with controller on given direction. Args: @@ -1476,7 +1476,9 @@ class _IsoLink: response = await self.device.send_command( hci.HCI_LE_Remove_ISO_Data_Path_Command( connection_handle=self.handle, - data_path_direction=direction, + data_path_direction=sum( + 1 << direction for direction in set(directions) + ), ), check_result=False, ) diff --git a/bumble/profiles/ascs.py b/bumble/profiles/ascs.py index a7c2e62a..a8bdce3d 100644 --- a/bumble/profiles/ascs.py +++ b/bumble/profiles/ascs.py @@ -516,7 +516,7 @@ class AseStateMachine(gatt.Characteristic): async def remove_cis_async(): if self.cis_link: - await self.cis_link.remove_data_path(self.role) + await self.cis_link.remove_data_path([self.role]) self.state = self.State.IDLE await self.service.device.notify_subscribers(self, self.value)