aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGilles Boccon-Gibod <boccongibod@google.com>2024-03-12 12:51:08 -0700
committerGitHub <noreply@github.com>2024-03-12 12:51:08 -0700
commit44c51c13ac9ccc1103e56fa4a093213b9df636cf (patch)
tree741746779adc6624bf24639b400916ccd55ffbfa
parent174930399ad17c93fef7fd21a55c14bd43ccafc3 (diff)
parent7507be1eabf4a78282e37034d62500c7550e407d (diff)
downloadbumble-44c51c13ac9ccc1103e56fa4a093213b9df636cf.tar.gz
Merge pull request #445 from google/gbg/driver-probe-fix
fix intel driver probe
-rw-r--r--bumble/drivers/intel.py8
-rw-r--r--bumble/host.py2
-rw-r--r--docs/mkdocs/src/drivers/index.md2
3 files changed, 8 insertions, 4 deletions
diff --git a/bumble/drivers/intel.py b/bumble/drivers/intel.py
index 1ef6105..c65d528 100644
--- a/bumble/drivers/intel.py
+++ b/bumble/drivers/intel.py
@@ -53,8 +53,12 @@ class Driver(common.Driver):
self.host = host
@classmethod
- async def for_host(cls, host, force=False): # type: ignore
- return cls(host)
+ async def for_host(cls, host): # type: ignore
+ # Only instantiate this driver if explicitly selected
+ if host.hci_metadata.get("driver") == "intel":
+ return cls(host)
+
+ return None
async def init_controller(self):
self.host.ready = True
diff --git a/bumble/host.py b/bumble/host.py
index ab0df66..fd0a247 100644
--- a/bumble/host.py
+++ b/bumble/host.py
@@ -498,7 +498,7 @@ class Host(AbortableEventEmitter):
def controller(self, controller) -> None:
self.set_packet_sink(controller)
if controller:
- controller.set_packet_sink(self)
+ self.set_packet_source(controller)
def set_packet_sink(self, sink: Optional[TransportSink]) -> None:
self.hci_sink = sink
diff --git a/docs/mkdocs/src/drivers/index.md b/docs/mkdocs/src/drivers/index.md
index cb0a981..aa5f0a1 100644
--- a/docs/mkdocs/src/drivers/index.md
+++ b/docs/mkdocs/src/drivers/index.md
@@ -10,7 +10,7 @@ used with particular HCI controller.
When the transport for an HCI controller is instantiated from a transport name,
a driver may also be forced by specifying ``driver=<driver-name>`` in the optional
metadata portion of the transport name. For example,
-``usb:[driver=-rtk]0`` indicates that the ``rtk`` driver should be used with the
+``usb:[driver=rtk]0`` indicates that the ``rtk`` driver should be used with the
first USB device, even if a normal probe would not have selected it based on the
USB vendor ID and product ID.