diff --git a/bumble/drivers/intel.py b/bumble/drivers/intel.py index 5dbec386e..fd3f41594 100644 --- a/bumble/drivers/intel.py +++ b/bumble/drivers/intel.py @@ -445,7 +445,6 @@ async def send_firmware_data(self, data_type: int, data: bytes) -> None: ) async def load_firmware(self) -> None: - self.host.ready = True device_info = await self.read_device_info() logger.debug( "device info: \n%s", @@ -663,7 +662,6 @@ async def reboot_bootloader(self) -> None: await asyncio.sleep(_POST_RESET_DELAY) async def read_device_info(self) -> dict[ValueType, Any]: - self.host.ready = True response1 = await self.host.send_sync_command_raw(hci.HCI_Reset_Command()) if not isinstance( response1.return_parameters, hci.HCI_StatusReturnParameters diff --git a/bumble/drivers/rtk.py b/bumble/drivers/rtk.py index 24bb78b3a..bccaea50a 100644 --- a/bumble/drivers/rtk.py +++ b/bumble/drivers/rtk.py @@ -555,11 +555,9 @@ async def driver_info_for_host(cls, host: Host) -> DriverInfo | None: hci.HCI_Reset_Command(), response_timeout=cls.POST_RESET_DELAY, ) - host.ready = True # Needed to let the host know the controller is ready. except asyncio.exceptions.TimeoutError: logger.warning("timeout waiting for hci reset, retrying") await host.send_sync_command(hci.HCI_Reset_Command()) - host.ready = True response = await host.send_sync_command_raw( hci.HCI_Read_Local_Version_Information_Command() diff --git a/bumble/host.py b/bumble/host.py index 992e042e3..7a514e23d 100644 --- a/bumble/host.py +++ b/bumble/host.py @@ -345,7 +345,8 @@ async def reset(self, driver_factory=drivers.get_driver_for_host) -> None: # Send a reset command unless a driver has already done so. if reset_needed: await self.send_sync_command(hci.HCI_Reset_Command()) - self.ready = True + + self.ready = True response1 = await self.send_sync_command( hci.HCI_Read_Local_Supported_Commands_Command() @@ -984,7 +985,10 @@ def on_packet(self, packet: bytes) -> None: if self.ready or ( isinstance(hci_packet, hci.HCI_Command_Complete_Event) - and hci_packet.command_opcode == hci.HCI_RESET_COMMAND + and ( + hci_packet.command_opcode == hci.HCI_RESET_COMMAND + or hci_packet.command_opcode >> 10 == hci.HCI_VENDOR_OGF + ) ): self.on_hci_packet(hci_packet) else: