Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions bumble/drivers/intel.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions bumble/drivers/rtk.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
8 changes: 6 additions & 2 deletions bumble/host.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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:
Expand Down
Loading