Fix wrong remove_data_path arguments

This commit is contained in:
Josh Wu
2025-05-21 00:08:43 +08:00
parent 3b399ea1a2
commit a875aa4055
2 changed files with 5 additions and 3 deletions

View File

@@ -1464,7 +1464,7 @@ class _IsoLink:
check_result=True, 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. """Remove a data path with controller on given direction.
Args: Args:
@@ -1476,7 +1476,9 @@ class _IsoLink:
response = await self.device.send_command( response = await self.device.send_command(
hci.HCI_LE_Remove_ISO_Data_Path_Command( hci.HCI_LE_Remove_ISO_Data_Path_Command(
connection_handle=self.handle, connection_handle=self.handle,
data_path_direction=direction, data_path_direction=sum(
1 << direction for direction in set(directions)
),
), ),
check_result=False, check_result=False,
) )

View File

@@ -516,7 +516,7 @@ class AseStateMachine(gatt.Characteristic):
async def remove_cis_async(): async def remove_cis_async():
if self.cis_link: 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 self.state = self.State.IDLE
await self.service.device.notify_subscribers(self, self.value) await self.service.device.notify_subscribers(self, self.value)