forked from auracaster/bumble_mirror
pandora: add tcp option to transport configuration
* Add a fallback to `tcp` when `transport` is not set. * Default the `tcp` transport to the default rootcanal HCI address.
This commit is contained in:
@@ -34,6 +34,10 @@ from bumble.sdp import (
|
|||||||
from typing import Any, Dict, List, Optional
|
from typing import Any, Dict, List, Optional
|
||||||
|
|
||||||
|
|
||||||
|
# Default rootcanal HCI TCP address
|
||||||
|
ROOTCANAL_HCI_ADDRESS = "localhost:6402"
|
||||||
|
|
||||||
|
|
||||||
class PandoraDevice:
|
class PandoraDevice:
|
||||||
"""
|
"""
|
||||||
Small wrapper around a Bumble device and it's HCI transport.
|
Small wrapper around a Bumble device and it's HCI transport.
|
||||||
@@ -53,7 +57,9 @@ class PandoraDevice:
|
|||||||
def __init__(self, config: Dict[str, Any]) -> None:
|
def __init__(self, config: Dict[str, Any]) -> None:
|
||||||
self.config = config
|
self.config = config
|
||||||
self.device = _make_device(config)
|
self.device = _make_device(config)
|
||||||
self._hci_name = config.get('transport', '')
|
self._hci_name = config.get(
|
||||||
|
'transport', f"tcp-client:{config.get('tcp', ROOTCANAL_HCI_ADDRESS)}"
|
||||||
|
)
|
||||||
self._hci = None
|
self._hci = None
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|||||||
Reference in New Issue
Block a user