xref: /freebsd/usr.sbin/bluetooth/hccontrol/hccontrol.8 (revision 058ac3e8063366dafa634d9107642e12b038bf09)
1.\" Copyright (c) 2001-2002 Maksim Yevmenkin <m_evmenkin@yahoo.com>
2.\" All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\"    notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\"    notice, this list of conditions and the following disclaimer in the
11.\"    documentation and/or other materials provided with the distribution.
12.\"
13.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23.\" SUCH DAMAGE.
24.\"
25.\" $Id: hccontrol.8,v 1.6 2003/08/06 21:26:38 max Exp $
26.\" $FreeBSD$
27.\"
28.Dd May 3, 2020
29.Dt HCCONTROL 8
30.Os
31.Sh NAME
32.Nm hccontrol
33.Nd Bluetooth HCI configuration utility
34.Sh SYNOPSIS
35.Nm
36.Op Fl hN
37.Op Fl n Ar HCI_node_name
38.Ar command
39.Op Ar parameters ...
40.Sh DESCRIPTION
41The
42.Nm
43utility connects to the specified Netgraph node of type
44.Dv HCI
45or the first one found if none is specified and attempts to send the specified
46command to the HCI Netgraph node or to the associated Bluetooth device.
47The
48.Nm
49utility will print results to the standard output and error messages to
50the standard error.
51.Pp
52The options are as follows:
53.Bl -tag -width indent
54.It Fl h
55Display usage message and exit.
56.It Fl N
57Show Bluetooth addresses as numbers.
58Normally
59.Nm
60attempts to resolve Bluetooth addresses, and display them symbolically.
61.It Fl n Ar HCI_node_name
62Connect to the specified HCI Netgraph node.
63.It Ar command
64One of the supported commands (see below).
65The special command
66.Cm help
67can be used to obtain the list of all supported commands.
68To get more information about a specific command use
69.Cm help Ar command .
70.It Ar parameters
71One or more optional space separated command parameters.
72Many commands require a remote device address as one of the parameters.
73The remote device address can be specified as BD_ADDR or a name.
74If a name was specified then the
75.Nm
76utility will attempt to resolve the name via
77.Xr bt_gethostbyname 3 .
78.El
79.Sh COMMANDS
80The currently supported HCI commands in
81.Nm
82are:
83.Pp
84.Bl -tag -width 40n -offset indent -compact
85.It Cm Inquiry
86.It Cm Create_Connection
87.It Cm Disconnect
88.It Cm Add_SCO_Connection
89.It Cm Change_Connection_Packet_Type
90.It Cm Remote_Name_Request
91.It Cm Read_Remote_Supported_Features
92.It Cm Read_Remote_Version_Information
93.It Cm Read_Clock_Offset
94.It Cm Role_Discovery
95.It Cm Switch_Role
96.It Cm Read_Link_Policy_Settings
97.It Cm Write_Link_Policy_Settings
98.It Cm Reset
99.It Cm Read_Pin_Type
100.It Cm Write_Pin_Type
101.It Cm Read_Stored_Link_Key
102.It Cm Write_Stored_Link_Key
103.It Cm Delete_Stored_Link_Key
104.It Cm Change_Local_Name
105.It Cm Read_Local_Name
106.It Cm Read_Connection_Accept_Timeout
107.It Cm Write_Connection_Accept_Timeout
108.It Cm Read_Page_Timeout
109.It Cm Write_Page_Timeout
110.It Cm Read_Scan_Enable
111.It Cm Write_Scan_Enable
112.It Cm Read_Page_Scan_Activity
113.It Cm Write_Page_Scan_Activity
114.It Cm Read_Inquiry_Scan_Activity
115.It Cm Write_Inquiry_Scan_Activity
116.It Cm Read_Authentication_Enable
117.It Cm Write_Authentication_Enable
118.It Cm Read_Encryption_Mode
119.It Cm Write_Encryption_Mode
120.It Cm Read_Class_Of_Device
121.It Cm Write_Class_Of_Device
122.It Cm Read_Voice_Settings
123.It Cm Write_Voice_Settings
124.It Cm Read_Number_Broadcast_Retransmissions
125.It Cm Write_Number_Broadcast_Retransmissions
126.It Cm Read_Hold_Mode_Activity
127.It Cm Write_Hold_Mode_Activity
128.It Cm Read_SCO_Flow_Control_Enable
129.It Cm Write_SCO_Flow_Control_Enable
130.It Cm Read_Link_Supervision_Timeout
131.It Cm Write_Link_Supervision_Timeout
132.It Cm Read_Page_Scan_Period_Mode
133.It Cm Write_Page_Scan_Period_Mode
134.It Cm Read_Page_Scan_Mode
135.It Cm Write_Page_Scan_Mode
136.It Cm Read_LE_Host_Support
137.It Cm Write_LE_Host_Support
138.It Cm Read_Local_Version_Information
139.It Cm Read_Local_Supported_Commands
140.It Cm Read_Local_Supported_Features
141.It Cm Read_Buffer_Size
142.It Cm Read_Country_Code
143.It Cm Read_BD_ADDR
144.It Cm Read_Failed_Contact_Counter
145.It Cm Reset_Failed_Contact_Counter
146.It Cm Get_Link_Quality
147.It Cm Read_RSSI
148.It Cm LE_Enable
149.It Cm LE_Read_Local_Supported_Features
150.It Cm LE_Set_Advertising_Parameters
151.It Cm LE_Read_Advertising_Physical_Channel_Tx_Power
152.It Cm LE_Set_Advertising_Data
153.It Cm LE_Set_Scan_Response_Data
154.It Cm LE_Set_Advertising_Enable
155.It Cm LE_Set_Scan_Parameters
156.It Cm LE_Set_Scan_Enable
157.It Cm LE_Read_Supported_States
158.It Cm LE_Read_Buffer_Size
159.It Cm LE_Scan
160.It Cm LE_Read_White_List_Size
161.It Cm LE_Clear_White_List
162.It Cm LE_Add_Device_To_White_List
163.It Cm LE_Remove_Device_From_White_List
164.It Cm LE_Connect
165.It Cm LE_Read_Channel_Map
166.It Cm LE_Read_Remote_Features
167.It Cm LE_Rand
168.El
169.Pp
170The currently supported node commands in
171.Nm
172are:
173.Pp
174.Bl -tag -width 40n -offset indent -compact
175.It Cm Read_Node_State
176.It Cm Initialize
177.It Cm Read_Debug_Level
178.It Cm Write_Debug_Level
179.It Cm Read_Node_Buffer_Size
180.It Cm Read_Node_BD_ADDR
181.It Cm Read_Node_Features
182.It Cm Read_Node_Stat
183.It Cm Reset_Node_Stat
184.It Cm Flush_Neighbor_Cache
185.It Cm Read_Neighbor_Cache
186.It Cm Read_Connection_List
187.It Cm Read_Node_Link_Policy_Settings_Mask
188.It Cm Write_Node_Link_Policy_Settings_Mask
189.It Cm Read_Node_Packet_Mask
190.It Cm Write_Node_Packet_Mask
191.It Cm Read_Node_Role_Switch
192.It Cm Write_Node_Role_Switch
193.It Cm Read_Node_List
194.El
195.Sh EXIT STATUS
196.Ex -std
197.Sh EXAMPLES
198Make the blutooth LE host, ubt0hci, scannable through
199.Xr hccontrol 8 commands:
200.Bd -literal -offset indent
201hccontrol -n ubt0hci le_set_advertising_enable disable
202hccontrol -n ubt0hci le_set_advertising_param
203hccontrol -n ubt0hci le_read_advertising_channel_tx_power
204hccontrol -n ubt0hci le_set_advertising_data
205hccontrol -n ubt0hci le_set_scan_response -n FBSD_Host
206hccontrol -n ubt0hci le_set_advertising_enable enable
207.Ed
208.Sh SEE ALSO
209.Xr bluetooth 3 ,
210.Xr netgraph 3 ,
211.Xr netgraph 4 ,
212.Xr ng_hci 4
213.Sh AUTHORS
214.An Maksim Yevmenkin Aq Mt m_evmenkin@yahoo.com
215.Sh BUGS
216Most likely.
217Please report if found.
218