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.\"
27.Dd May 3, 2020
28.Dt HCCONTROL 8
29.Os
30.Sh NAME
31.Nm hccontrol
32.Nd Bluetooth HCI configuration utility
33.Sh SYNOPSIS
34.Nm
35.Op Fl hN
36.Op Fl n Ar HCI_node_name
37.Ar command
38.Op Ar parameters ...
39.Sh DESCRIPTION
40The
41.Nm
42utility connects to the specified Netgraph node of type
43.Dv HCI
44or the first one found if none is specified and attempts to send the specified
45command to the HCI Netgraph node or to the associated Bluetooth device.
46The
47.Nm
48utility will print results to the standard output and error messages to
49the standard error.
50.Pp
51The options are as follows:
52.Bl -tag -width indent
53.It Fl h
54Display usage message and exit.
55.It Fl N
56Show Bluetooth addresses as numbers.
57Normally
58.Nm
59attempts to resolve Bluetooth addresses, and display them symbolically.
60.It Fl n Ar HCI_node_name
61Connect to the specified HCI Netgraph node.
62.It Ar command
63One of the supported commands (see below).
64The special command
65.Cm help
66can be used to obtain the list of all supported commands.
67To get more information about a specific command use
68.Cm help Ar command .
69.It Ar parameters
70One or more optional space separated command parameters.
71Many commands require a remote device address as one of the parameters.
72The remote device address can be specified as BD_ADDR or a name.
73If a name was specified then the
74.Nm
75utility will attempt to resolve the name via
76.Xr bt_gethostbyname 3 .
77.El
78.Sh COMMANDS
79The currently supported HCI commands in
80.Nm
81are:
82.Pp
83.Bl -tag -width 40n -offset indent -compact
84.It Cm Inquiry
85.It Cm Create_Connection
86.It Cm Disconnect
87.It Cm Add_SCO_Connection
88.It Cm Change_Connection_Packet_Type
89.It Cm Remote_Name_Request
90.It Cm Read_Remote_Supported_Features
91.It Cm Read_Remote_Version_Information
92.It Cm Read_Clock_Offset
93.It Cm Role_Discovery
94.It Cm Switch_Role
95.It Cm Read_Link_Policy_Settings
96.It Cm Write_Link_Policy_Settings
97.It Cm Reset
98.It Cm Read_Pin_Type
99.It Cm Write_Pin_Type
100.It Cm Read_Stored_Link_Key
101.It Cm Write_Stored_Link_Key
102.It Cm Delete_Stored_Link_Key
103.It Cm Change_Local_Name
104.It Cm Read_Local_Name
105.It Cm Read_Connection_Accept_Timeout
106.It Cm Write_Connection_Accept_Timeout
107.It Cm Read_Page_Timeout
108.It Cm Write_Page_Timeout
109.It Cm Read_Scan_Enable
110.It Cm Write_Scan_Enable
111.It Cm Read_Page_Scan_Activity
112.It Cm Write_Page_Scan_Activity
113.It Cm Read_Inquiry_Scan_Activity
114.It Cm Write_Inquiry_Scan_Activity
115.It Cm Read_Authentication_Enable
116.It Cm Write_Authentication_Enable
117.It Cm Read_Encryption_Mode
118.It Cm Write_Encryption_Mode
119.It Cm Read_Class_Of_Device
120.It Cm Write_Class_Of_Device
121.It Cm Read_Voice_Settings
122.It Cm Write_Voice_Settings
123.It Cm Read_Number_Broadcast_Retransmissions
124.It Cm Write_Number_Broadcast_Retransmissions
125.It Cm Read_Hold_Mode_Activity
126.It Cm Write_Hold_Mode_Activity
127.It Cm Read_SCO_Flow_Control_Enable
128.It Cm Write_SCO_Flow_Control_Enable
129.It Cm Read_Link_Supervision_Timeout
130.It Cm Write_Link_Supervision_Timeout
131.It Cm Read_Page_Scan_Period_Mode
132.It Cm Write_Page_Scan_Period_Mode
133.It Cm Read_Page_Scan_Mode
134.It Cm Write_Page_Scan_Mode
135.It Cm Read_LE_Host_Support
136.It Cm Write_LE_Host_Support
137.It Cm Read_Local_Version_Information
138.It Cm Read_Local_Supported_Commands
139.It Cm Read_Local_Supported_Features
140.It Cm Read_Buffer_Size
141.It Cm Read_Country_Code
142.It Cm Read_BD_ADDR
143.It Cm Read_Failed_Contact_Counter
144.It Cm Reset_Failed_Contact_Counter
145.It Cm Get_Link_Quality
146.It Cm Read_RSSI
147.It Cm LE_Enable
148.It Cm LE_Read_Local_Supported_Features
149.It Cm LE_Set_Advertising_Parameters
150.It Cm LE_Read_Advertising_Physical_Channel_Tx_Power
151.It Cm LE_Set_Advertising_Data
152.It Cm LE_Set_Scan_Response_Data
153.It Cm LE_Set_Advertising_Enable
154.It Cm LE_Set_Scan_Parameters
155.It Cm LE_Set_Scan_Enable
156.It Cm LE_Read_Supported_States
157.It Cm LE_Read_Buffer_Size
158.It Cm LE_Scan
159.It Cm LE_Read_White_List_Size
160.It Cm LE_Clear_White_List
161.It Cm LE_Add_Device_To_White_List
162.It Cm LE_Remove_Device_From_White_List
163.It Cm LE_Connect
164.It Cm LE_Read_Channel_Map
165.It Cm LE_Read_Remote_Features
166.It Cm LE_Rand
167.El
168.Pp
169The currently supported node commands in
170.Nm
171are:
172.Pp
173.Bl -tag -width 40n -offset indent -compact
174.It Cm Read_Node_State
175.It Cm Initialize
176.It Cm Read_Debug_Level
177.It Cm Write_Debug_Level
178.It Cm Read_Node_Buffer_Size
179.It Cm Read_Node_BD_ADDR
180.It Cm Read_Node_Features
181.It Cm Read_Node_Stat
182.It Cm Reset_Node_Stat
183.It Cm Flush_Neighbor_Cache
184.It Cm Read_Neighbor_Cache
185.It Cm Read_Connection_List
186.It Cm Read_Node_Link_Policy_Settings_Mask
187.It Cm Write_Node_Link_Policy_Settings_Mask
188.It Cm Read_Node_Packet_Mask
189.It Cm Write_Node_Packet_Mask
190.It Cm Read_Node_Role_Switch
191.It Cm Write_Node_Role_Switch
192.It Cm Read_Node_List
193.El
194.Sh EXIT STATUS
195.Ex -std
196.Sh EXAMPLES
197Make the blutooth LE host, ubt0hci, scannable through
198.Xr hccontrol 8 commands:
199.Bd -literal -offset indent
200hccontrol -n ubt0hci le_set_advertising_enable disable
201hccontrol -n ubt0hci le_set_advertising_param
202hccontrol -n ubt0hci le_read_advertising_channel_tx_power
203hccontrol -n ubt0hci le_set_advertising_data
204hccontrol -n ubt0hci le_set_scan_response -n FBSD_Host
205hccontrol -n ubt0hci le_set_advertising_enable enable
206.Ed
207.Sh SEE ALSO
208.Xr bluetooth 3 ,
209.Xr netgraph 3 ,
210.Xr netgraph 4 ,
211.Xr ng_hci 4
212.Sh AUTHORS
213.An Maksim Yevmenkin Aq Mt m_evmenkin@yahoo.com
214.Sh BUGS
215Most likely.
216Please report if found.
217