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.
List Adapters
Section titled “List Adapters”bt_list_adaptersReturns 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 }]Get Adapter Details
Section titled “Get Adapter Details”bt_adapter_info adapter="hci0"Returns detailed information including supported features and UUIDs.
Power Control
Section titled “Power Control”Turn Bluetooth On
Section titled “Turn Bluetooth On”bt_adapter_power adapter="hci0" on=trueTurn Bluetooth Off
Section titled “Turn Bluetooth Off”bt_adapter_power adapter="hci0" on=falseDiscovery Settings
Section titled “Discovery Settings”Make Discoverable
Section titled “Make Discoverable”Allow other devices to see your computer:
bt_adapter_discoverable adapter="hci0" on=true timeout=180timeout=0means discoverable forever (use carefully)timeout=180means 3 minutes (default)
Stop Being Discoverable
Section titled “Stop Being Discoverable”bt_adapter_discoverable adapter="hci0" on=falsePairing Acceptance
Section titled “Pairing Acceptance”Enable Pairing
Section titled “Enable Pairing”Allow devices to pair with your computer:
bt_adapter_pairable adapter="hci0" on=true timeout=0Disable Pairing
Section titled “Disable Pairing”bt_adapter_pairable adapter="hci0" on=falseSet Adapter Name
Section titled “Set Adapter Name”Change the friendly name other devices see:
bt_adapter_set_alias adapter="hci0" alias="Ryan's Desktop"Common Workflows
Section titled “Common Workflows”Prepare for Incoming Connection
Section titled “Prepare for Incoming Connection”When you want another device to find and connect to your computer:
# Make discoverable and pairablebt_adapter_discoverable adapter="hci0" on=true timeout=300bt_adapter_pairable adapter="hci0" on=true timeout=300This opens a 5-minute window for pairing.
Secure Configuration
Section titled “Secure Configuration”For everyday use with known devices:
# Hidden but accepting connections from paired devicesbt_adapter_discoverable adapter="hci0" on=falsebt_adapter_pairable adapter="hci0" on=falseAdapter Properties Reference
Section titled “Adapter Properties Reference”| Property | Description |
|---|---|
name | System name (e.g., hci0) |
address | MAC address |
alias | Friendly name |
powered | On/off state |
discoverable | Visible to other devices |
discoverable_timeout | Seconds until auto-hidden (0=forever) |
pairable | Accepting new pairings |
pairable_timeout | Seconds until auto-disable (0=forever) |
discovering | Currently scanning |
uuids | Supported Bluetooth profiles |
modalias | Hardware identifier |
Multiple Adapters
Section titled “Multiple Adapters”If you have multiple Bluetooth adapters (e.g., built-in + USB dongle):
# List all adaptersbt_list_adapters
# Configure each separatelybt_adapter_power adapter="hci0" on=truebt_adapter_power adapter="hci1" on=falseTroubleshooting
Section titled “Troubleshooting”Adapter Not Found
Section titled “Adapter Not Found”Check if the kernel sees your hardware:
# List USB Bluetooth deviceslsusb | grep -i bluetooth
# Check kernel messagesdmesg | grep -i bluetooth
# Verify btusb module is loadedlsmod | grep btusbAdapter Won’t Power On
Section titled “Adapter Won’t Power On”BlueZ might be blocked by rfkill:
# Check rfkill statusrfkill list bluetooth
# Unblock if blockedrfkill unblock bluetoothDiscovery Stops Unexpectedly
Section titled “Discovery Stops Unexpectedly”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.