Enable WCNSS LE before Bluetooth discovery
Live btmgmt/btmon showed hci0 powered with le absent from current settings; BlueZ issued only BR/EDR Inquiry, so BLE peripherals were invisible. Add a narrow doas helper to run btmgmt -i hci0 le on before each interactive scan, make bluez-btmgmt explicit, add the doas rule, host guards and docs. With real peripherals in pairing mode the plugin UI reported 5 devices and retained BT KeyBoard / LE-QC Ultra entries.
This commit is contained in:
1 parent
77127c7844
commit
e4358665f7
11 files changed
+58
-9
No files matched your search
@@ -18,6 +18,8 @@ WRAPPER = BASE / "overlay/rootfs/usr/local/bin/bluetoothctl"
|
||||
HELPER = BASE / "overlay/rootfs/usr/bin/bananarchy-bt-scan.sh"
|
||||
OVERLAY = BASE / "scripts/apply-bananarchy-overlay.sh"
|
||||
PACKAGES = BASE / "scripts/rootfs-packages.txt"
|
||||
LE_HELPER = BASE / "overlay/rootfs/usr/bin/bananarchy-bt-le-enable.sh"
|
||||
DOAS_RULE = BASE / "overlay/rootfs/etc/doas.d/60-bananarchy-bluetooth.conf"
|
||||
|
||||
STUB = r'''#!/usr/bin/env python3
|
||||
import sys
|
||||
@@ -52,6 +54,8 @@ def main():
|
||||
raise SystemExit("missing executable overlay/usr/local/bin/bluetoothctl")
|
||||
if not HELPER.is_file() or not os.access(HELPER, os.X_OK):
|
||||
raise SystemExit("missing executable overlay/usr/bin/bananarchy-bt-scan.sh")
|
||||
if not LE_HELPER.is_file() or not os.access(LE_HELPER, os.X_OK):
|
||||
raise SystemExit("missing executable overlay/usr/bin/bananarchy-bt-le-enable.sh")
|
||||
|
||||
wrapper = read(WRAPPER)
|
||||
helper = read(HELPER)
|
||||
@@ -63,18 +67,27 @@ def main():
|
||||
}
|
||||
if "util-linux-misc" not in packages:
|
||||
raise SystemExit("rootfs package set is missing util-linux-misc (script)")
|
||||
if "bluez-btmgmt" not in packages:
|
||||
raise SystemExit("rootfs package set is missing bluez-btmgmt (LE enable)")
|
||||
for token in ("BANANARCHY_REAL_BLUETOOTHCTL", "BANANARCHY_BT_SCAN_HELPER",
|
||||
'" scan on "', 'exec "$REAL" "$@"'):
|
||||
if token not in wrapper:
|
||||
raise SystemExit("bluetoothctl wrapper is missing %s" % token)
|
||||
for token in ("script -q -c", "menu scan", "transport auto",
|
||||
"duplicate-data on", "scan on", "devices", "scan off",
|
||||
"quit", "BANANARCHY_BT_SCAN_SECONDS"):
|
||||
"quit", "BANANARCHY_BT_SCAN_SECONDS",
|
||||
"bananarchy-bt-le-enable.sh"):
|
||||
if token not in helper:
|
||||
raise SystemExit("live scan helper is missing %s" % token)
|
||||
for token in ("usr/local/bin/bluetoothctl", "usr/bin/bananarchy-bt-scan.sh"):
|
||||
for token in ("usr/local/bin/bluetoothctl", "usr/bin/bananarchy-bt-scan.sh",
|
||||
"usr/bin/bananarchy-bt-le-enable.sh",
|
||||
"etc/doas.d/60-bananarchy-bluetooth.conf"):
|
||||
if token not in overlay:
|
||||
raise SystemExit("overlay application is not installing %s" % token)
|
||||
if not DOAS_RULE.is_file() or "bananarchy-bt-le-enable.sh" not in read(DOAS_RULE):
|
||||
raise SystemExit("doas rule is missing the LE enable helper")
|
||||
if "btmgmt -i hci0 le on" not in read(LE_HELPER):
|
||||
raise SystemExit("LE enable helper lost its btmgmt command")
|
||||
print("[ok] live Bluetooth discovery wiring")
|
||||
|
||||
with tempfile.TemporaryDirectory(prefix="bananarchy-bt-scan-") as tmp:
|
||||
|
||||
Reference in new issue
Block a user