Adapter Tools
Tools for managing Bluetooth hardware adapters.
bt_list_adapters
Section titled “bt_list_adapters”List all Bluetooth adapters on the system.
Parameters: None
Returns:
[ { "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 }]Example:
bt_list_adaptersbt_adapter_info
Section titled “bt_adapter_info”Get detailed information about a specific adapter.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
adapter | string | Yes | Adapter name (e.g., “hci0”) |
Returns:
{ "name": "hci0", "address": "AA:BB:CC:DD:EE:FF", "alias": "My Laptop", "class": 7995916, "powered": true, "discoverable": false, "discoverable_timeout": 180, "pairable": true, "pairable_timeout": 0, "discovering": false, "uuids": [ "0000110a-0000-1000-8000-00805f9b34fb", "0000110c-0000-1000-8000-00805f9b34fb" ], "modalias": "usb:v1D6Bp0246d0540"}Example:
bt_adapter_info adapter="hci0"bt_adapter_power
Section titled “bt_adapter_power”Power an adapter on or off.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
adapter | string | Yes | Adapter name |
on | boolean | Yes | true to power on, false to power off |
Returns: Updated adapter info
Example:
bt_adapter_power adapter="hci0" on=trueNotes:
- Powering off disconnects all devices
- Stops any ongoing discovery
bt_adapter_discoverable
Section titled “bt_adapter_discoverable”Set adapter discoverable (visible to other devices).
Parameters:
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
adapter | string | Yes | - | Adapter name |
on | boolean | Yes | - | Enable/disable discoverable |
timeout | integer | No | 180 | Seconds until auto-hidden (0 = forever) |
Returns: Updated adapter info
Example:
# Discoverable for 5 minutesbt_adapter_discoverable adapter="hci0" on=true timeout=300
# Discoverable forever (use carefully)bt_adapter_discoverable adapter="hci0" on=true timeout=0
# Hide from other devicesbt_adapter_discoverable adapter="hci0" on=falsebt_adapter_pairable
Section titled “bt_adapter_pairable”Set adapter pairable state.
Parameters:
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
adapter | string | Yes | - | Adapter name |
on | boolean | Yes | - | Enable/disable pairing acceptance |
timeout | integer | No | 0 | Seconds until auto-disable (0 = forever) |
Returns: Updated adapter info
Example:
# Accept pairings for 5 minutesbt_adapter_pairable adapter="hci0" on=true timeout=300
# Stop accepting pairingsbt_adapter_pairable adapter="hci0" on=falsebt_adapter_set_alias
Section titled “bt_adapter_set_alias”Set adapter friendly name (alias).
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
adapter | string | Yes | Adapter name |
alias | string | Yes | New friendly name |
Returns: Updated adapter info
Example:
bt_adapter_set_alias adapter="hci0" alias="Ryan's Desktop"bt_scan
Section titled “bt_scan”Scan for nearby Bluetooth devices.
Parameters:
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
adapter | string | Yes | - | Adapter name |
timeout | integer | No | 10 | Scan duration in seconds |
mode | string | No | ”both” | Scan mode: “classic”, “ble”, or “both” |
Returns:
[ { "address": "AA:BB:CC:DD:EE:FF", "name": "My Device", "alias": "My Device", "paired": false, "connected": false, "rssi": -65, "uuids": ["0000110a-..."], "manufacturer_data": {...}, "service_data": {...} }]Example:
# Standard scanbt_scan adapter="hci0" timeout=10
# BLE onlybt_scan adapter="hci0" timeout=15 mode="ble"
# Classic only (faster for headphones, speakers)bt_scan adapter="hci0" timeout=10 mode="classic"Notes:
- Starts discovery, waits for timeout, then stops
- BLE devices must be advertising to be found
- Returns devices discovered during the scan period