Home » Linux Kernel » Linux Device Drivers » Bluetooth driver » Configure host ( PC / Laptop ) Bluetooth device on Ubuntu using hciconfig

Configure host ( PC / Laptop ) Bluetooth device on Ubuntu using hciconfig

hciconfig is used to configure Bluetooth devices on host like laptop or PC.

 hciconfig -h
 hciconfig [-a]
 hciconfig [-a] hciX [command [command parameters]]

hciX is the name of a Bluetooth device installed in the system. If hciX is not given, hciconfig prints name and basic information about all the Bluetooth devices installed in the system. If hciX is given but no command is given, it prints basic information on device hciX only. Basic information is interface type, BD address, ACL MTU, SCO MTU, flags (up, init, running, raw, page scan enabled, inquiry scan enabled, inquiry, authentication enabled, encryption enabled).

$ hciconfig -a
hci0: Type: BR/EDR  Bus: USB
 BD Address: 70:1A:04:59:69:04  ACL MTU: 1021:8  SCO MTU: 64:8
 UP RUNNING PSCAN 
 RX bytes:1495 acl:0 sco:0 events:61 errors:0
 TX bytes:3623 acl:0 sco:0 commands:53 errors:0
 Features: 0xff 0xff 0x8f 0xfe 0x9b 0xff 0x79 0x83
 Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3 
 Link policy: RSWITCH HOLD SNIFF PARK 
 Link mode: SLAVE ACCEPT 
 Name: 'ubuntu-0'
 Class: 0x2c010c
 Service Classes: Rendering, Capturing, Audio
 Device Class: Computer, Laptop
 HCI Version: 2.1 (0x4)  Revision: 0x51c8
 LMP Version: 2.1 (0x4)  Subversion: 0x423d
 Manufacturer: Broadcom Corporation (15)

Other commands supported by hciconfig are as below,

$ hciconfig --help
hciconfig - HCI device configuration utility
Usage:
	hciconfig
	hciconfig [-a] hciX [command ...]
Commands:
	up                 	Open and initialize HCI device
	down               	Close HCI device
	reset              	Reset HCI device
	rstat              	Reset statistic counters
	auth               	Enable Authentication
	noauth             	Disable Authentication
	encrypt            	Enable Encryption
	noencrypt          	Disable Encryption
	piscan             	Enable Page and Inquiry scan
	noscan             	Disable scan
	iscan              	Enable Inquiry scan
	pscan              	Enable Page scan
	ptype      [type]  	Get/Set default packet type
	lm         [mode]  	Get/Set default link mode
	lp         [policy]	Get/Set default link policy
	name       [name]  	Get/Set local name
	class      [class] 	Get/Set class of device
	voice      [voice] 	Get/Set voice setting
	iac        [iac]   	Get/Set inquiry access code
	inqtpl     [level] 	Get/Set inquiry transmit power level
	inqmode    [mode]  	Get/Set inquiry mode
	inqdata    [data]  	Get/Set inquiry data
	inqtype    [type]  	Get/Set inquiry scan type
	inqparms   [win:int]	Get/Set inquiry scan window and interval
	pageparms  [win:int]	Get/Set page scan window and interval
	pageto     [to]    	Get/Set page timeout
	afhmode    [mode]  	Get/Set AFH mode
	sspmode    [mode]  	Get/Set Simple Pairing Mode
	aclmtu     	Set ACL MTU and number of packets
	scomtu     	Set SCO MTU and number of packets
	delkey     	Delete link key from the device
	oobdata            	Get local OOB data
	commands           	Display supported commands
	features           	Display device features
	version            	Display version information
	revision           	Display revision information
	block      	Add a device to the blacklist
	unblock    	Remove a device from the blacklist
	lerandaddr 	Set LE Random Address
	leadv      [type]  	Enable LE advertising
			0 - Connectable undirected advertising (default)
			3 - Non connectable undirected advertising
	noleadv            	Disable LE advertising
	lestates           	Display the supported LE states

Subscribe our Rurban Life YouTube Channel.. "Rural Life, Urban LifeStyle"

Leave a Comment