Skip to content

Adapter Management

import { Aside } from ‘@astrojs/starlight/components’;

Bluetooth adapters are the hardware interfaces that enable wireless communication. mcbluetooth provides full control over adapter configuration.

bt_list_adapters

Returns all Bluetooth adapters with their current state:

[
{
"name": "hci0",
"address": "AA:BB:CC:DD:EE:FF",
"alias": "My Laptop",
"powered": true,
"discoverable": false,
"discoverable_timeout": 180,
"pairable": true,
"pairable_timeout": 0,
"discovering": false
}
]
bt_adapter_info adapter="hci0"

Returns detailed information including supported features and UUIDs.

bt_adapter_power adapter="hci0" on=true
bt_adapter_power adapter="hci0" on=false

Allow other devices to see your computer:

bt_adapter_discoverable adapter="hci0" on=true timeout=180
  • timeout=0 means discoverable forever (use carefully)
  • timeout=180 means 3 minutes (default)
bt_adapter_discoverable adapter="hci0" on=false

Allow devices to pair with your computer:

bt_adapter_pairable adapter="hci0" on=true timeout=0
bt_adapter_pairable adapter="hci0" on=false

Change the friendly name other devices see:

bt_adapter_set_alias adapter="hci0" alias="Ryan's Desktop"

When you want another device to find and connect to your computer:

# Make discoverable and pairable
bt_adapter_discoverable adapter="hci0" on=true timeout=300
bt_adapter_pairable adapter="hci0" on=true timeout=300

This opens a 5-minute window for pairing.

For everyday use with known devices:

# Hidden but accepting connections from paired devices
bt_adapter_discoverable adapter="hci0" on=false
bt_adapter_pairable adapter="hci0" on=false
PropertyDescription
nameSystem name (e.g., hci0)
addressMAC address
aliasFriendly name
poweredOn/off state
discoverableVisible to other devices
discoverable_timeoutSeconds until auto-hidden (0=forever)
pairableAccepting new pairings
pairable_timeoutSeconds until auto-disable (0=forever)
discoveringCurrently scanning
uuidsSupported Bluetooth profiles
modaliasHardware identifier

If you have multiple Bluetooth adapters (e.g., built-in + USB dongle):

# List all adapters
bt_list_adapters
# Configure each separately
bt_adapter_power adapter="hci0" on=true
bt_adapter_power adapter="hci1" on=false

Check if the kernel sees your hardware:

Terminal window
# List USB Bluetooth devices
lsusb | grep -i bluetooth
# Check kernel messages
dmesg | grep -i bluetooth
# Verify btusb module is loaded
lsmod | grep btusb

BlueZ might be blocked by rfkill:

Terminal window
# Check rfkill status
rfkill list bluetooth
# Unblock if blocked
rfkill unblock bluetooth

Discovery has a default timeout. For continuous scanning:

bt_scan adapter="hci0" timeout=60 mode="both"

The bt_scan tool handles starting and stopping discovery automatically.