forked from auracaster/bumble_mirror
terminate when unplugged
This commit is contained in:
@@ -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:
|
||||||
|
|||||||
Reference in New Issue
Block a user