terminate when unplugged

This commit is contained in:
Gilles Boccon-Gibod
2023-11-19 11:36:38 -08:00
parent a8ec1b0949
commit 9c7089c8ff

View File

@@ -24,9 +24,10 @@ import platform
import usb1 import usb1
from .common import Transport, ParserSource from bumble.transport.common import Transport, ParserSource
from .. import hci from bumble import hci
from ..colors import color from bumble.colors import color
from bumble.utils import AsyncRunner
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
@@ -271,6 +272,7 @@ async def open_usb_transport(spec: str) -> Transport:
logger.warning( logger.warning(
color(f'!!! IN transfer not completed: status={status}', 'red') color(f'!!! IN transfer not completed: status={status}', 'red')
) )
self.loop.call_soon_threadsafe(self.on_transport_lost)
async def dequeue(self): async def dequeue(self):
while not self.closed: while not self.closed: