xref: /netbsd/usr.sbin/btdevctl/btdevctl.8 (revision cc848d6e)
1.\" $NetBSD: btdevctl.8,v 1.12 2015/06/12 09:43:05 plunky Exp $
2.\"
3.\" Copyright (c) 2006 Itronix Inc.
4.\" All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\" 3. The name of Itronix Inc. may not be used to endorse
15.\"    or promote products derived from this software without specific
16.\"    prior written permission.
17.\"
18.\" THIS SOFTWARE IS PROVIDED BY ITRONIX INC. ``AS IS'' AND
19.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL ITRONIX INC. BE LIABLE FOR ANY
22.\" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23.\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
25.\" ON ANY THEORY OF LIABILITY, WHETHER IN
26.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28.\" POSSIBILITY OF SUCH DAMAGE.
29.\"
30.\" Copyright (c) 2004 Maksim Yevmenkin <m_evmenkin@yahoo.com>
31.\" All rights reserved.
32.\"
33.\" Redistribution and use in source and binary forms, with or without
34.\" modification, are permitted provided that the following conditions
35.\" are met:
36.\" 1. Redistributions of source code must retain the above copyright
37.\"    notice, this list of conditions and the following disclaimer.
38.\" 2. Redistributions in binary form must reproduce the above copyright
39.\"    notice, this list of conditions and the following disclaimer in the
40.\"    documentation and/or other materials provided with the distribution.
41.\"
42.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
43.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
44.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
45.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
46.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
47.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
48.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
49.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
50.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
51.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
52.\" SUCH DAMAGE.
53.\"
54.Dd December 26, 2012
55.Dt BTDEVCTL 8
56.Os
57.Sh NAME
58.Nm btdevctl
59.Nd Bluetooth remote device control utility
60.Sh SYNOPSIS
61.Nm
62.Op Fl A | Fl D
63.Op Fl qv
64.Op Fl m Ar mode
65.Fl a Ar address
66.Fl d Ar device
67.Fl s Ar service
68.Sh DESCRIPTION
69The
70.Nm
71utility is used to configure bluetooth devices in the system.
72Normally,
73.Nm
74will perform an SDP query to the remote device as needed, and
75cache the results in the
76.Pa /var/db/btdevctl.plist
77file for later use.
78If neither Attach nor Detach is specified,
79.Nm
80will display the configuration.
81.Pp
82The options are:
83.Bl -tag
84.It Fl A
85Attach device
86.It Fl a Ar address
87Remote device address.
88The
89.Ar address
90may be given as BDADDR or a name.
91If a name was specified,
92.Nm
93attempts to resolve the name via
94.Xr bt_gethostbyname 3 .
95.It Fl D
96Detach device
97.It Fl d Ar device
98Local device address.
99May be given as BDADDR or device name.
100.It Fl m Ar mode
101Connection link mode.
102The following modes are supported:
103.Pp
104.Bl -tag -width encrypt -compact
105.It none
106clear previously set mode.
107.It auth
108require devices be paired, see
109.Xr btpin 1 .
110.It encrypt
111auth, plus enable encryption.
112.It secure
113encryption, plus change of link key.
114.El
115.Pp
116When configuring the HID service,
117.Nm
118will set
119.Sq auth
120by default, or
121.Sq encrypt
122for keyboard devices.
123If the device cannot handle authentication, then the mode will need
124to be cleared manually.
125.It Fl q
126Ignore any cached data and perform a SDP query for the given
127.Ar service .
128.It Fl s Ar service
129Service to configure.
130Known services are:
131.Pp
132.Bl -tag -width HSETXX -compact
133.It Dv HID
134Human Interface Device.
135.It Dv HF
136Handsfree.
137.It Dv HSET
138Headset.
139.El
140.It Fl v
141Be verbose.
142.El
143.Pp
144For device configurations to persist across boots, add entries to the
145.Pa /etc/bluetooth/btdevctl.conf
146file and ensure the
147.Xr rc.conf 5
148variable
149.Sy bluetooth
150is set to YES.
151.Sh FILES
152.Bl -tag -compact
153.It Pa /etc/bluetooth/btdevctl.conf
154.It Pa /dev/bthub
155.It Pa /var/db/btdevctl.plist
156.El
157.Sh EXIT STATUS
158.Ex -std
159.Sh SEE ALSO
160.Xr btpin 1 ,
161.Xr bthidev 4 ,
162.Xr bthub 4 ,
163.Xr btsco 4 ,
164.Xr rc.conf 5
165.Pp
166See the Bluetooth chapter of
167.Qq The NetBSD Guide
168for detailed examples of configuring keyboards, mice, and audio headsets.
169.Sh HISTORY
170Parts of the
171.Nm
172program originated in the
173.Fx
174.Nm bthidcontrol
175program.
176.Sh AUTHORS
177.An Iain Hibbert
178for Itronix, Inc.
179.An Maksim Yevmenkin Aq Mt m_evmenkin@yahoo.com
180