最終更新:2022-07-12 (火) 01:28:01 (653d)  

hcitool
Top / hcitool

HCI Tool

configure Bluetooth connection

# hcitool dev - ローカルデバイスを一覧表示
# hcitool scan - リモートデバイスを検索 (デバイス名)
# hcitool inq - リモートデバイスを検索 (アドレス、クロックオフセット、クラス)
# hcitool name - リモートデバイスの名前を取得
# hcitool info - リモートデバイスの情報を取得

Ubuntu/パッケージ

メモ

  • hcitool -i hci0 lescan

コマンド

  • hcitool devDisplay local devices
    hcitool inqInquire remote devices. For each discovered device, Bluetooth device address, clock offset and class are printed.
    hcitool scanInquire remote devices. For each discovered device, device name are printed.
    hcitool name <bdaddr>Print device name of remote device with Bluetooth address bdaddr.
    hcitool info <bdaddr>Print device name, version and supported features of remote device with Bluetooth address bdaddr.
    hcitool spinq?Start periodic inquiry process. No inquiry results are printed.
    hcitool epinq?Exit periodic inquiry process.
    hcitool cmd <ogf> <ocf> [parameters]Submit an arbitrary HCI command to local device. ogf, ocf and parameters are hexadecimal bytes.
    hcitool conDisplay active baseband connections
    hcitool cc [--role=m | s] [--pkt-type=<ptype>] <bdaddr>Create baseband connection to remote device with Bluetooth address bdaddr. Option --pkt-type specifies a list of allowed packet types. <ptype> is a comma-separated list of packet types, where the possible packet types are DM1, DM3, DM5, DH1, DH3, DH5, HV1, HV2, HV3. Default is to allow all packet types. Option --role can have value m (do not allow role switch, stay master) or s (allow role switch, become slave if the peer asks to become master). Default is m.
    hcitool dc? <bdaddr> [reason]Delete baseband connection from remote device with Bluetooth address bdaddr. The reason can be one of the Bluetooth HCI error codes. Default is 19 for user ended connections. The value must be given in decimal.
    hcitool sr? <bdaddr> <role>Switch role for the baseband connection from the remote device to master or slave.
    hcitool cpt? <bdaddr> <packet types>Change packet types for baseband connection to device with Bluetooth address bdaddr. packet types is a comma-separated list of packet types, where the possible packet types are DM1, DM3, DM5, DH1, DH3, DH5, HV1, HV2, HV3.
    hcitool rssi? <bdaddr>Display received signal strength information for the connection to the device with Bluetooth address bdaddr.
    hcitool lq? <bdaddr>Display link quality for the connection to the device with Bluetooth address bdaddr.
    hcitool tpl? <bdaddr> [type]Display transmit power level for the connection to the device with Bluetooth address bdaddr. The type can be 0 for the current transmit power level (which is default) or 1 for the maximum transmit power level.
    hcitool afh? <bdaddr>Display AFH channel map for the connection to the device with Bluetooth address bdaddr.
    hcitool lp? <bdaddr> [value]With no value, displays link policy settings for the connection to the device with Bluetooth address bdaddr. If value is given, sets the link policy settings for that connection to value. Possible values are RSWITCH, HOLD, SNIFF and PARK.
    hcitool lst? <bdaddr> [value]With no value, displays link supervision timeout for the connection to the device with Bluetooth address bdaddr. If value is given, sets the link supervision timeout for that connection to value slots, or to infinite if value is 0.
    hcitool auth? <bdaddr>Request authentication for the device with Bluetooth address bdaddr.
    hcitool enc? <bdaddr> [encrypt enable]Enable or disable the encryption for the device with Bluetooth address bdaddr.
    hcitool key? <bdaddr>Change the connection link key for the device with Bluetooth address bdaddr.
    hcitool clkoff? <bdaddr>Read the clock offset for the device with Bluetooth address bdaddr.
    hcitool clock? [bdaddr] [which clock]Read the clock for the device with Bluetooth address bdaddr. The clock can be 0 for the local clock or 1 for the piconet clock (which is default).
    hcitool lescanStart LE scan
    hcitool leinfoGet LE remote information
    hcitool lewladd?Add device to LE White List
    hcitool lewlrm?Remove device from LE White List
    hcitool lewlsz?Read size of LE White List
    hcitool lewlclr?Clear LE White List
    hcitool lerladd?Add device to LE Resolving List
    hcitool lerlrm?Remove device from LE Resolving List
    hcitool lerlclr?Clear LE Resolving List
    hcitool lerlsz?Read size of LE Resolving List
    hcitool lerlon?Enable LE Address Resolution
    hcitool lerloff?Disable LE Address Resolution
    hcitool lecc?Create a LE Connection
    hcitool ledc?Disconnect a LE Connection
    hcitool lecup?LE Connection Update

help

  • hcitool - HCI Tool ver 5.55
    Usage:
    	hcitool [options] <command> [command parameters]
    Options:
    	--help	Display help
    	-i dev	HCI device
    Commands:
    	dev 	Display local devices
    	inq 	Inquire remote devices
    	scan	Scan for remote devices
    	name	Get name from remote device
    	info	Get information from remote device
    	spinq	Start periodic inquiry
    	epinq	Exit periodic inquiry
    	cmd 	Submit arbitrary HCI commands
    	con 	Display active connections
    	cc  	Create connection to remote device
    	dc  	Disconnect from remote device
    	sr  	Switch master/slave role
    	cpt 	Change connection packet type
    	rssi	Display connection RSSI
    	lq  	Display link quality
    	tpl 	Display transmit power level
    	afh 	Display AFH channel map
    	lp  	Set/display link policy settings
    	lst 	Set/display link supervision timeout
    	auth	Request authentication
    	enc 	Set connection encryption
    	key 	Change connection link key
    	clkoff	Read clock offset
    	clock	Read local or remote clock
    	lescan	Start LE scan
    	leinfo	Get LE remote information
    	lewladd	Add device to LE White List
    	lewlrm	Remove device from LE White List
    	lewlsz	Read size of LE White List
    	lewlclr	Clear LE White List
    	lerladd	Add device to LE Resolving List
    	lerlrm	Remove device from LE Resolving List
    	lerlclr	Clear LE Resolving List
    	lerlsz	Read size of LE Resolving List
    	lerlon	Enable LE Address Resolution
    	lerloff	Disable LE Address Resolution
    	lecc	Create a LE Connection
    	ledc	Disconnect a LE Connection
    	lecup	LE Connection Update
    
    For more information on the usage of each command use:
    	hcitool <command> --help
    

5.48

  • 	dev 	Display local devices
    	inq 	Inquire remote devices
    	scan	Scan for remote devices
    	name	Get name from remote device
    	info	Get information from remote device
    	spinq	Start periodic inquiry
    	epinq	Exit periodic inquiry
    	cmd 	Submit arbitrary HCI commands
    	con 	Display active connections
    	cc  	Create connection to remote device
    	dc  	Disconnect from remote device
    	sr  	Switch master/slave role
    	cpt 	Change connection packet type
    	rssi	Display connection RSSI
    	lq  	Display link quality
    	tpl 	Display transmit power level
    	afh 	Display AFH channel map
    	lp  	Set/display link policy settings
    	lst 	Set/display link supervision timeout
    	auth	Request authentication
    	enc 	Set connection encryption
    	key 	Change connection link key
    	clkoff	Read clock offset
    	clock	Read local or remote clock
    	lescan	Start LE scan
    	leinfo	Get LE remote information
    	lewladd	Add device to LE White List
    	lewlrm	Remove device from LE White List
    	lewlsz	Read size of LE White List
    	lewlclr	Clear LE White List
    	lerladd	Add device to LE Resolving List
    	lerlrm	Remove device from LE Resolving List
    	lerlclr	Clear LE Resolving List
    	lerlsz	Read size of LE Resolving List
    	lerlon	Enable LE Address Resolution
    	lerloff	Disable LE Address Resolution
    	lecc	Create a LE Connection
    	ledc	Disconnect a LE Connection
    	lecup	LE Connection Update

近くにあるかどうかの判定

関連