Skip to content
Merged
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
3 changes: 0 additions & 3 deletions apps/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ Apps
## `show.py`
Parse a file with HCI packets and print the details of each packet in a human readable form

## `link_relay.py`
Simple WebSocket relay for virtual RemoteLink instances to communicate with each other through.

## `hci_bridge.py`
This app acts as a simple bridge between two HCI transports, with a host on one side and
a controller on the other. All the HCI packets bridged between the two are printed on the console
Expand Down
6 changes: 3 additions & 3 deletions apps/bench.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
DataElement,
ServiceAttribute,
)
from bumble.transport import open_transport_or_link
from bumble.transport import open_transport
import bumble.rfcomm
import bumble.core
from bumble.utils import AsyncRunner
Expand Down Expand Up @@ -1470,7 +1470,7 @@ def __init__(

async def run(self):
logging.info(color('>>> Connecting to HCI...', 'green'))
async with await open_transport_or_link(self.transport) as (
async with await open_transport(self.transport) as (
hci_source,
hci_sink,
):
Expand Down Expand Up @@ -1705,7 +1705,7 @@ def __init__(

async def run(self):
logging.info(color('>>> Connecting to HCI...', 'green'))
async with await open_transport_or_link(self.transport) as (
async with await open_transport(self.transport) as (
hci_source,
hci_sink,
):
Expand Down
4 changes: 2 additions & 2 deletions apps/console.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
Peer,
)
from bumble.utils import AsyncRunner
from bumble.transport import open_transport_or_link
from bumble.transport import open_transport
from bumble.gatt import Characteristic, Service, CharacteristicDeclaration, Descriptor
from bumble.gatt_client import CharacteristicProxy
from bumble.hci import (
Expand Down Expand Up @@ -291,7 +291,7 @@ def _(event):
async def run_async(self, device_config, transport):
rssi_monitoring_task = asyncio.create_task(self.rssi_monitor_loop())

async with await open_transport_or_link(transport) as (hci_source, hci_sink):
async with await open_transport(transport) as (hci_source, hci_sink):
if device_config:
self.device = Device.from_config_file_with_hci(
device_config, hci_source, hci_sink
Expand Down
4 changes: 2 additions & 2 deletions apps/controller_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
HCI_Read_Local_Version_Information_Command,
)
from bumble.host import Host
from bumble.transport import open_transport_or_link
from bumble.transport import open_transport


# -----------------------------------------------------------------------------
Expand Down Expand Up @@ -246,7 +246,7 @@ async def async_main(
latency_probes, latency_probe_interval, latency_probe_command, transport
):
print('<<< connecting to HCI...')
async with await open_transport_or_link(transport) as (hci_source, hci_sink):
async with await open_transport(transport) as (hci_source, hci_sink):
print('<<< connected')

host = Host(hci_source, hci_sink)
Expand Down
4 changes: 2 additions & 2 deletions apps/controller_loopback.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
LoopbackMode,
)
from bumble.host import Host
from bumble.transport import open_transport_or_link
from bumble.transport import open_transport
import click


Expand Down Expand Up @@ -88,7 +88,7 @@ def on_l2cap_pdu(self, connection_handle: int, cid: int, pdu: bytes):
async def run(self):
"""Run a loopback throughput test"""
print(color('>>> Connecting to HCI...', 'green'))
async with await open_transport_or_link(self.transport) as (
async with await open_transport(self.transport) as (
hci_source,
hci_sink,
):
Expand Down
4 changes: 2 additions & 2 deletions apps/controllers.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

from bumble.controller import Controller
from bumble.link import LocalLink
from bumble.transport import open_transport_or_link
from bumble.transport import open_transport


# -----------------------------------------------------------------------------
Expand All @@ -42,7 +42,7 @@ async def async_main():
transports = []
controllers = []
for index, transport_name in enumerate(sys.argv[1:]):
transport = await open_transport_or_link(transport_name)
transport = await open_transport(transport_name)
transports.append(transport)
controller = Controller(
f'C{index}',
Expand Down
4 changes: 2 additions & 2 deletions apps/device_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
from bumble.profiles.pacs import PublishedAudioCapabilitiesServiceProxy
from bumble.profiles.tmap import TelephonyAndMediaAudioServiceProxy
from bumble.profiles.vcs import VolumeControlServiceProxy
from bumble.transport import open_transport_or_link
from bumble.transport import open_transport


# -----------------------------------------------------------------------------
Expand Down Expand Up @@ -215,7 +215,7 @@ async def show_device_info(peer, done: Optional[asyncio.Future]) -> None:

# -----------------------------------------------------------------------------
async def async_main(device_config, encrypt, transport, address_or_name):
async with await open_transport_or_link(transport) as (hci_source, hci_sink):
async with await open_transport(transport) as (hci_source, hci_sink):

# Create a device
if device_config:
Expand Down
4 changes: 2 additions & 2 deletions apps/gatt_dump.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from bumble.colors import color
from bumble.device import Device, Peer
from bumble.gatt import show_services
from bumble.transport import open_transport_or_link
from bumble.transport import open_transport


# -----------------------------------------------------------------------------
Expand Down Expand Up @@ -60,7 +60,7 @@ async def dump_gatt_db(peer, done):

# -----------------------------------------------------------------------------
async def async_main(device_config, encrypt, transport, address_or_name):
async with await open_transport_or_link(transport) as (hci_source, hci_sink):
async with await open_transport(transport) as (hci_source, hci_sink):

# Create a device
if device_config:
Expand Down
4 changes: 2 additions & 2 deletions apps/gg_bridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
from bumble.core import AdvertisingData
from bumble.gatt import Service, Characteristic, CharacteristicValue
from bumble.utils import AsyncRunner
from bumble.transport import open_transport_or_link
from bumble.transport import open_transport
from bumble.hci import HCI_Constant


Expand Down Expand Up @@ -325,7 +325,7 @@ async def run(
receive_port,
):
print('<<< connecting to HCI...')
async with await open_transport_or_link(hci_transport) as (hci_source, hci_sink):
async with await open_transport(hci_transport) as (hci_source, hci_sink):
print('<<< connected')

# Instantiate a bridge object
Expand Down
4 changes: 2 additions & 2 deletions apps/hci_bridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ async def async_main():
return

print('>>> connecting to HCI...')
async with await transport.open_transport_or_link(sys.argv[1]) as (
async with await transport.open_transport(sys.argv[1]) as (
hci_host_source,
hci_host_sink,
):
print('>>> connected')

print('>>> connecting to HCI...')
async with await transport.open_transport_or_link(sys.argv[2]) as (
async with await transport.open_transport(sys.argv[2]) as (
hci_controller_source,
hci_controller_sink,
):
Expand Down
4 changes: 2 additions & 2 deletions apps/l2cap_bridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

from bumble import l2cap
from bumble.colors import color
from bumble.transport import open_transport_or_link
from bumble.transport import open_transport
from bumble.device import Device
from bumble.utils import FlowControlAsyncPipe
from bumble.hci import HCI_Constant
Expand Down Expand Up @@ -258,7 +258,7 @@ def on_l2cap_close():
# -----------------------------------------------------------------------------
async def run(device_config, hci_transport, bridge):
print('<<< connecting to HCI...')
async with await open_transport_or_link(hci_transport) as (hci_source, hci_sink):
async with await open_transport(hci_transport) as (hci_source, hci_sink):
print('<<< connected')

device = Device.from_config_file_with_hci(device_config, hci_source, hci_sink)
Expand Down
Empty file removed apps/link_relay/__init__.py
Empty file.
Loading
Loading