Skip to content

Adapter Tools

Tools for managing Bluetooth hardware 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_adapters

Get detailed information about a specific adapter.

Parameters:

NameTypeRequiredDescription
adapterstringYesAdapter 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"

Power an adapter on or off.

Parameters:

NameTypeRequiredDescription
adapterstringYesAdapter name
onbooleanYestrue to power on, false to power off

Returns: Updated adapter info

Example:

bt_adapter_power adapter="hci0" on=true

Notes:

  • Powering off disconnects all devices
  • Stops any ongoing discovery

Set adapter discoverable (visible to other devices).

Parameters:

NameTypeRequiredDefaultDescription
adapterstringYes-Adapter name
onbooleanYes-Enable/disable discoverable
timeoutintegerNo180Seconds until auto-hidden (0 = forever)

Returns: Updated adapter info

Example:

# Discoverable for 5 minutes
bt_adapter_discoverable adapter="hci0" on=true timeout=300
# Discoverable forever (use carefully)
bt_adapter_discoverable adapter="hci0" on=true timeout=0
# Hide from other devices
bt_adapter_discoverable adapter="hci0" on=false

Set adapter pairable state.

Parameters:

NameTypeRequiredDefaultDescription
adapterstringYes-Adapter name
onbooleanYes-Enable/disable pairing acceptance
timeoutintegerNo0Seconds until auto-disable (0 = forever)

Returns: Updated adapter info

Example:

# Accept pairings for 5 minutes
bt_adapter_pairable adapter="hci0" on=true timeout=300
# Stop accepting pairings
bt_adapter_pairable adapter="hci0" on=false

Set adapter friendly name (alias).

Parameters:

NameTypeRequiredDescription
adapterstringYesAdapter name
aliasstringYesNew friendly name

Returns: Updated adapter info

Example:

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

Scan for nearby Bluetooth devices.

Parameters:

NameTypeRequiredDefaultDescription
adapterstringYes-Adapter name
timeoutintegerNo10Scan duration in seconds
modestringNo”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 scan
bt_scan adapter="hci0" timeout=10
# BLE only
bt_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