Comprehensive Guide to Bluetooth HCI Configuration
Explore the full range of commands and configurations available with hciconfig for managing Bluetooth Host Controller Interface (HCI) settings.
Learn how to open, close, reset, enable authentication and encryption, set scan modes, configure device parameters, and more with hciconfig.
If hci0 dev is gone and bluetooth is totally broken try
hciconfig hci0 piscan
After piscan was runned then we run noscan
hciconfig hci0 noscan
It is required to install net-wireless/bluez with deprecated useflag to get hcitool command
echo "net-wireless/bluez deprecated" >> /etc/portage/package.use/bluez
emerge --ask --changed-use net-wireless/bluez
Bluetooth hardware info
{ hciconfig; hciconfig -a hci0; lsmod | grep -i bt; dmesg | grep -i bluetooth; }
Get interface name and mac address for our bluetooth device
hciconfig
hci0: Type: Primary Bus: USB
BD Address: 22:10:13:FC:20:1A ACL MTU: 310:10 SCO MTU: 64:8
UP RUNNING PSCAN
RX bytes:6232 acl:0 sco:0 events:110 errors:0
TX bytes:5271 acl:0 sco:0 commands:89 errors:0
Open and initialize HCI device
hciconfig -a <hci0> up
Close HCI device
hciconfig -a <hci0> down
Reset HCI device
hciconfig -a <hci0> reset
Reset statistic counters
hciconfig -a <hci0> rstat
Enable Authentication
hciconfig -a <hci0> auth
Disable Authentication
hciconfig -a <hci0> noauth
Enable Encryption
hciconfig -a <hci0> encrypt
Disable Encryption
hciconfig -a <hci0> noencrypt
Enable Page and Inquiry scan
hciconfig -a <hci0> piscan
Disable scan
hciconfig -a <hci0> noscan
Enable Inquiry scan
hciconfig -a <hci0> iscan
Enable Page scan
hciconfig -a <hci0> pscan
Get/Set default packet type
hciconfig -a <hci0> ptype [type]
Get/Set default link mode
hciconfig -a <hci0> lm [mode]
Get/Set default link policy
hciconfig -a <hci0> lp [policy]
Get/Set local name
hciconfig -a <hci0> name [name]
Get/Set class of device
hciconfig -a <hci0> class [class]
Get/Set voice setting
hciconfig -a <hci0> voice [voice]
Get/Set inquiry access code
hciconfig -a <hci0> iac [iac]
Get/Set inquiry transmit power level
hciconfig -a <hci0> nqtpl [level]
Get/Set inquiry mode
hciconfig -a <hci0> inqmode [mode]
Get/Set inquiry data
hciconfig -a <hci0> inqdata [data]
Get/Set inquiry scan type
hciconfig -a <hci0> inqtype [type]
Get/Set inquiry scan window and interval
hciconfig -a <hci0> inqparms [win:int]
Get/Set page scan window and interval
hciconfig -a <hci0> pageparms [win:int]
Get/Set page timeout
hciconfig -a <hci0> ageto [to]
Get/Set AFH mode
hciconfig -a <hci0> afhmode [mode]
Get/Set Simple Pairing Mode
hciconfig -a <hci0> sspmode [mode]
Set ACL MTU and number of packets
hciconfig -a <hci0> clmtu <mtu:pkt>
Set SCO MTU and number of packets
hciconfig -a <hci0> scomtu <mtu:pkt>
Delete link key from the device
hciconfig -a <hci0> delkey <bdaddr>
Get local OOB data
hciconfig -a <hci0> oobdata
Display supported commands
hciconfig -a <hci0> commands
Display device features
hciconfig -a <hci0> eatures
Display version information
hciconfig -a <hci0> version
Display revision information
hciconfig -a <hci0> revision
Add a device to the blacklist
hciconfig -a <hci0> block <bdaddr>
Remove a device from the blacklist
hciconfig -a <hci0> unblock <bdaddr>
Set LE Random Address
hciconfig -a <hci0> lerandaddr <bdaddr>
Enable LE advertising
hciconfig -a <hci0> leadv [type]
Show all commands device has support for
hciconfig get commands