diff --git a/apps/gg_bridge.py b/apps/gg_bridge.py index 5e5574b4..402b8efe 100644 --- a/apps/gg_bridge.py +++ b/apps/gg_bridge.py @@ -352,7 +352,7 @@ async def run( await bridge.start() # Wait until the source terminates - await hci_source.wait_for_termination() + await hci_source.terminated @click.command() diff --git a/apps/l2cap_bridge.py b/apps/l2cap_bridge.py index aaccc129..bef07c68 100644 --- a/apps/l2cap_bridge.py +++ b/apps/l2cap_bridge.py @@ -268,7 +268,7 @@ async def run(device_config, hci_transport, bridge): await bridge.start(device) # Wait until the transport terminates - await hci_source.wait_for_termination() + await hci_source.terminated # ----------------------------------------------------------------------------- diff --git a/apps/rfcomm_bridge.py b/apps/rfcomm_bridge.py index b0b27ca8..6b5f3ef9 100644 --- a/apps/rfcomm_bridge.py +++ b/apps/rfcomm_bridge.py @@ -421,7 +421,7 @@ async def run(device_config, hci_transport, bridge): await bridge.start(device) # Wait until the transport terminates - await hci_source.wait_for_termination() + await hci_source.terminated except core.ConnectionError as error: print(color(f"!!! Bluetooth connection failed: {error}", "red")) except Exception as error: diff --git a/apps/scan.py b/apps/scan.py index 7de628e6..5761190f 100644 --- a/apps/scan.py +++ b/apps/scan.py @@ -190,7 +190,7 @@ async def scan( scanning_phys=scanning_phys, ) - await hci_source.wait_for_termination() + await hci_source.terminated # ----------------------------------------------------------------------------- diff --git a/apps/speaker/speaker.py b/apps/speaker/speaker.py index 777025b6..4ca97319 100644 --- a/apps/speaker/speaker.py +++ b/apps/speaker/speaker.py @@ -726,7 +726,7 @@ async def run(self, connect_address): print("Waiting for connection...") await self.advertise() - await hci_source.wait_for_termination() + await hci_source.terminated for output in self.outputs: await output.stop() diff --git a/examples/device_information_server.py b/examples/device_information_server.py index 9d3bc6d1..bce0c7d6 100644 --- a/examples/device_information_server.py +++ b/examples/device_information_server.py @@ -65,7 +65,7 @@ async def main() -> None: # Go! await device.power_on() await device.start_advertising(auto_restart=True) - await hci_transport.source.wait_for_termination() + await hci_transport.source.terminated # ----------------------------------------------------------------------------- diff --git a/examples/run_a2dp_sink.py b/examples/run_a2dp_sink.py index 1d4f2a2b..fab4ff22 100644 --- a/examples/run_a2dp_sink.py +++ b/examples/run_a2dp_sink.py @@ -161,7 +161,7 @@ async def main() -> None: await device.set_discoverable(True) await device.set_connectable(True) - await hci_transport.source.wait_for_termination() + await hci_transport.source.terminated # ----------------------------------------------------------------------------- diff --git a/examples/run_a2dp_source.py b/examples/run_a2dp_source.py index 4766cdf5..8ed185e4 100644 --- a/examples/run_a2dp_source.py +++ b/examples/run_a2dp_source.py @@ -181,7 +181,7 @@ async def read(byte_count): await device.set_discoverable(True) await device.set_connectable(True) - await hci_transport.source.wait_for_termination() + await hci_transport.source.terminated # ----------------------------------------------------------------------------- diff --git a/examples/run_advertiser.py b/examples/run_advertiser.py index 2049075b..a52e82bb 100644 --- a/examples/run_advertiser.py +++ b/examples/run_advertiser.py @@ -70,7 +70,7 @@ async def main() -> None: await device.power_on() await device.start_advertising(advertising_type=advertising_type, target=target) - await hci_transport.source.wait_for_termination() + await hci_transport.source.terminated # ----------------------------------------------------------------------------- diff --git a/examples/run_classic_discoverable.py b/examples/run_classic_discoverable.py index bad08f60..a8c10f8f 100644 --- a/examples/run_classic_discoverable.py +++ b/examples/run_classic_discoverable.py @@ -112,7 +112,7 @@ async def main() -> None: await device.set_discoverable(True) await device.set_connectable(True) - await hci_transport.source.wait_for_termination() + await hci_transport.source.terminated # ----------------------------------------------------------------------------- diff --git a/examples/run_classic_discovery.py b/examples/run_classic_discovery.py index 77d036e2..153a23c4 100644 --- a/examples/run_classic_discovery.py +++ b/examples/run_classic_discovery.py @@ -73,7 +73,7 @@ async def main() -> None: await device.power_on() await device.start_discovery() - await hci_transport.source.wait_for_termination() + await hci_transport.source.terminated # ----------------------------------------------------------------------------- diff --git a/examples/run_connect_and_encrypt.py b/examples/run_connect_and_encrypt.py index 5515ade2..02d25f55 100644 --- a/examples/run_connect_and_encrypt.py +++ b/examples/run_connect_and_encrypt.py @@ -57,7 +57,7 @@ async def main() -> None: print(f'!!! Encryption failed: {error}') return - await hci_transport.source.wait_for_termination() + await hci_transport.source.terminated # ----------------------------------------------------------------------------- diff --git a/examples/run_controller.py b/examples/run_controller.py index d25d32fb..c634e18f 100644 --- a/examples/run_controller.py +++ b/examples/run_controller.py @@ -101,7 +101,7 @@ async def main() -> None: await device.start_advertising() await device.start_scanning() - await hci_transport.source.wait_for_termination() + await hci_transport.source.terminated # ----------------------------------------------------------------------------- diff --git a/examples/run_device_with_snooper.py b/examples/run_device_with_snooper.py index c7752d81..c8ae6477 100644 --- a/examples/run_device_with_snooper.py +++ b/examples/run_device_with_snooper.py @@ -48,7 +48,7 @@ async def main() -> None: await device.power_on() await device.start_scanning() - await hci_transport.source.wait_for_termination() + await hci_transport.source.terminated # ----------------------------------------------------------------------------- diff --git a/examples/run_gatt_server.py b/examples/run_gatt_server.py index afc6c05a..a4430f51 100644 --- a/examples/run_gatt_server.py +++ b/examples/run_gatt_server.py @@ -147,7 +147,7 @@ async def main() -> None: else: await device.start_advertising(auto_restart=True) - await hci_transport.source.wait_for_termination() + await hci_transport.source.terminated # ----------------------------------------------------------------------------- diff --git a/examples/run_gatt_server_with_pairing_delegate.py b/examples/run_gatt_server_with_pairing_delegate.py index 151baec6..e4b36b6a 100644 --- a/examples/run_gatt_server_with_pairing_delegate.py +++ b/examples/run_gatt_server_with_pairing_delegate.py @@ -99,7 +99,7 @@ async def main() -> None: else: await device.start_advertising(auto_restart=True) - await hci_transport.source.wait_for_termination() + await hci_transport.source.terminated # ----------------------------------------------------------------------------- diff --git a/examples/run_gatt_with_adapters.py b/examples/run_gatt_with_adapters.py index 81e2ca9a..82be0519 100644 --- a/examples/run_gatt_with_adapters.py +++ b/examples/run_gatt_with_adapters.py @@ -422,7 +422,7 @@ async def main() -> None: # Setup a server await server(device) - await hci_transport.source.wait_for_termination() + await hci_transport.source.terminated # ----------------------------------------------------------------------------- diff --git a/examples/run_hfp_handsfree.py b/examples/run_hfp_handsfree.py index 33bd2137..2caf67b8 100644 --- a/examples/run_hfp_handsfree.py +++ b/examples/run_hfp_handsfree.py @@ -167,7 +167,7 @@ async def serve(websocket: websockets.asyncio.server.ServerConnection): await websockets.asyncio.server.serve(serve, 'localhost', 8989) - await hci_transport.source.wait_for_termination() + await hci_transport.source.terminated # ----------------------------------------------------------------------------- diff --git a/examples/run_hid_device.py b/examples/run_hid_device.py index 0c7fb361..696e7349 100644 --- a/examples/run_hid_device.py +++ b/examples/run_hid_device.py @@ -735,7 +735,7 @@ async def menu(): print("Executing in Web mode") await keyboard_device(hid_device) - await hci_transport.source.wait_for_termination() + await hci_transport.source.terminated # ----------------------------------------------------------------------------- diff --git a/examples/run_hid_host.py b/examples/run_hid_host.py index f6153f19..a3d4feff 100644 --- a/examples/run_hid_host.py +++ b/examples/run_hid_host.py @@ -556,7 +556,7 @@ async def menu(): # Interrupt Channel await hid_host.connect_interrupt_channel() - await hci_transport.source.wait_for_termination() + await hci_transport.source.terminated # ----------------------------------------------------------------------------- diff --git a/examples/run_rfcomm_client.py b/examples/run_rfcomm_client.py index d8017975..b91792e0 100644 --- a/examples/run_rfcomm_client.py +++ b/examples/run_rfcomm_client.py @@ -227,7 +227,7 @@ async def main() -> None: tcp_port = int(sys.argv[5]) asyncio.create_task(tcp_server(tcp_port, session)) - await hci_transport.source.wait_for_termination() + await hci_transport.source.terminated # ----------------------------------------------------------------------------- diff --git a/examples/run_rfcomm_server.py b/examples/run_rfcomm_server.py index 94a5a2f4..4e2d020c 100644 --- a/examples/run_rfcomm_server.py +++ b/examples/run_rfcomm_server.py @@ -153,7 +153,7 @@ async def main() -> None: await device.set_discoverable(True) await device.set_connectable(True) - await hci_transport.source.wait_for_termination() + await hci_transport.source.terminated # ----------------------------------------------------------------------------- diff --git a/examples/run_scanner.py b/examples/run_scanner.py index 6bb7e788..8c56cb1a 100644 --- a/examples/run_scanner.py +++ b/examples/run_scanner.py @@ -75,7 +75,7 @@ def on_adv(advertisement): await device.power_on() await device.start_scanning(filter_duplicates=filter_duplicates) - await hci_transport.source.wait_for_termination() + await hci_transport.source.terminated # -----------------------------------------------------------------------------