xref: /netbsd-src/usr.sbin/btdevctl/btdevctl.8 (revision ba65fde2d7fefa7d39838fa5fa855e62bd606b5e)
1.\" $NetBSD: btdevctl.8,v 1.9 2012/12/26 17:57:49 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
147set the
148.Xr rc.conf 5
149variable
150.Sy btdevctl
151to YES.
152.Sh FILES
153.Bl -tag -compact
154.It Pa /etc/bluetooth/btdevctl.conf
155.It Pa /dev/bthub
156.It Pa /var/db/btdevctl.plist
157.El
158.Sh EXIT STATUS
159.Ex -std
160.Sh SEE ALSO
161.Xr btpin 1 ,
162.Xr bthidev 4 ,
163.Xr bthub 4 ,
164.Xr btsco 4 ,
165.Xr rc.conf 5
166.Pp
167See the Bluetooth chapter of
168.Qq The NetBSD Guide
169for detailed examples of configuring keyboards, mice, and audio headsets.
170.Sh HISTORY
171Parts of the
172.Nm
173program originated in the
174.Fx
175.Nm bthidcontrol
176program.
177.Sh AUTHORS
178.An Iain Hibbert
179for Itronix, Inc.
180.An Maksim Yevmenkin Aq m_evmenkin@yahoo.com
181