File: bluetoothctl.1

package info (click to toggle)
bluez 5.85-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 20,016 kB
  • sloc: ansic: 423,507; python: 4,751; sh: 4,580; makefile: 750; xml: 126
file content (457 lines) | stat: -rw-r--r-- 10,067 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
.\" Man page generated from reStructuredText.
.
.
.nr rst2man-indent-level 0
.
.de1 rstReportMargin
\\$1 \\n[an-margin]
level \\n[rst2man-indent-level]
level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
-
\\n[rst2man-indent0]
\\n[rst2man-indent1]
\\n[rst2man-indent2]
..
.de1 INDENT
.\" .rstReportMargin pre:
. RS \\$1
. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
. nr rst2man-indent-level +1
.\" .rstReportMargin post:
..
.de UNINDENT
. RE
.\" indent \\n[an-margin]
.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
.nr rst2man-indent-level -1
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.TH "BLUETOOTHCTL" "1" "March 2024" "BlueZ" "Linux System Administration"
.SH NAME
bluetoothctl \- Bluetooth Control Command Line Tool
.SH SYNOPSIS
.sp
\fBbluetoothctl\fP [\fB\-a\fP \fIcapability\fP] [\fB\-e\fP] [\fB\-m\fP] [\fB\-t\fP \fIseconds\fP]
[\fB\-v\fP] [\fB\-h\fP]
.SH DESCRIPTION
.sp
\fBbluetoothctl(1)\fP interactive bluetooth control tool. The tool works with
Bluetooth Classic (BR/EDR) and Bluetooth Low Energy (LE) controllers.
.sp
The tool is menu driven but can be automated from the command line.
Examples are given in the automation section.
.SH OPTIONS
.INDENT 0.0
.TP
.BI \-a \ capability\fR,\fB \ \-\-agent \ capability
Register agent handler: <capability>
.TP
.B  \-e\fP,\fB  \-\-endpoints
Register Media endpoints
.TP
.B  \-m\fP,\fB  \-\-monitor
Enable monitor output
.TP
.BI \-t \ seconds\fR,\fB \ \-\-timeout \ seconds
Timeout in seconds for non\-interactive mode
.TP
.B  \-v\fP,\fB  \-\-version
Display version
.TP
.B  \-h\fP,\fB  \-\-help
Display help
.UNINDENT
.SH COMMANDS
.SS list
.sp
List available controllers.
.INDENT 0.0
.TP
.B Usage
\fB> list\fP
.UNINDENT
.SS show
.sp
Controller information.
.INDENT 0.0
.TP
.B Usage
\fB> show [ctrl]\fP
.UNINDENT
.SS select
.sp
Select default controller.
.INDENT 0.0
.TP
.B Usage
\fB> select <ctrl>\fP
.UNINDENT
.SS devices
.sp
List available devices, with an optional property as the filter.
.INDENT 0.0
.TP
.B Usage
\fB> devices [Paired/Bonded/Trusted/Connected]\fP
.UNINDENT
.SS system\-alias
.sp
Set controller alias.
.INDENT 0.0
.TP
.B Usage
\fB> system\-alias <name>\fP
.UNINDENT
.SS reset\-alias
.sp
Reset controller alias.
.INDENT 0.0
.TP
.B Usage
\fB> reset\-alias\fP
.UNINDENT
.SS power
.sp
Set controller power.
.sp
When the controller is powered off, the USB port the controller is attached to
is put into a suspend state.
.INDENT 0.0
.TP
.B Usage
\fB> power <on/off>\fP
.UNINDENT
.SS advertise
.sp
Enable/disable advertising with given type.
.sp
If you exit the program advertising will be disabled.
.sp
When advertising the controller should advertise with random address but may
use its public address if it does not support the feature (address of the
device).
.sp
A device can advertise if it initiated the connection to another advertising
device.
.INDENT 0.0
.TP
.B Usage
\fB> advertise <on/off/type>\fP
.UNINDENT
.SS set\-alias
.sp
Set device alias.
.INDENT 0.0
.TP
.B Usage
\fB> set\-alias <alias>\fP
.UNINDENT
.SS scan
.sp
Scan for devices.
.sp
For LE, scanning is an important requirement before connecting or pairing.
.sp
The purpose of scanning is to find devices that are advertising with their
discoverable flag set (either limited or general). Once you have found the
address then you can connect or pair.
.sp
Note the following when scanning:
.INDENT 0.0
.INDENT 3.5
.INDENT 0.0
.IP \(bu 2
When scanning the controller will use a random address that is not
resolvable so the public address is not leaked. A new random address is
created every time scan on is used.
.IP \(bu 2
When turning on scanning the device will start receiving advertising reports
of what devices are advertising.
.IP \(bu 2
The filtering of duplicate advertising reports may be enabled depending on
the filtering settings.
.IP \(bu 2
Device objects found during a scan session will only be persisted if they
are connected/paired otherwise they are removed after some time.
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B Usage
\fB> scan <on/off/bredr/le>\fP
.UNINDENT
.SS pair
.sp
Pair with device.
.sp
This will pair with a device and then trust and connect to it. If the device is
already paired this will first remove the pairing.
.sp
The command can either be used while the controller is in the connected or not
connected state.
.sp
If the controller is already connected then the pair command can be used without
an arguments. If the controller is not connected, the pair command can be given
the address of a device with an active scan report and it will initiate the
connection before pairing.
.sp
Before pairing the agent must be selected to choose the authentication
mechanism.
.INDENT 0.0
.TP
.B Usage
\fB> pair <dev>\fP
.UNINDENT
.SS pairable
.sp
Set controller pairable mode.
.sp
This enables/disables pairing. If pairing is disabled then the controller will
not accept any pairing requests.
.INDENT 0.0
.TP
.B Usage
\fB> pairable <on/off>\fP
.UNINDENT
.SS discoverable
.sp
Set discoverable mode.
.sp
This enables/disables discoverable mode. If discoverable is disabled then the
controller will not respond to any scan requests.
.sp
In LE if discoverable if off the controller will just passively scan and not
make scan requests to advertising devices. If on it will make the advertising
requests.
.sp
It will use a random address if supported by the controller. The length of time
\(dqdiscoverable on\(dq is valid is determined by discoverable\-timeout command.
.INDENT 0.0
.TP
.B Usage
\fB> discoverable <on/off>\fP
.UNINDENT
.SS discoverable\-timeout
.sp
Set discoverable timeout.
.sp
The time in seconds that \(dqdiscoverable on\(dq is valid.
.INDENT 0.0
.TP
.B Usage
\fB> discoverable\-timeout [value]\fP
.UNINDENT
.SS agent
.sp
Enable/disable agent with given capability.
.sp
This chooses the local authentication mechanism of the controller. It is needed
for pairing and allows you to choose the IO capabilities of the controller.
.sp
The valid agent capabilities are: DisplayOnly, DisplayYesNo, KeyboardDisplay,
KeyboardOnly, NoInputNoOutput.
.INDENT 0.0
.TP
.B Usage
\fB> agent <on/off/capability>\fP
.UNINDENT
.SS default\-agent
.sp
Set current agent as the default one.
.sp
After selecting the agent this will make it the default agent.
.INDENT 0.0
.TP
.B Usage
\fB> default\-agent\fP
.UNINDENT
.SS trust
.sp
Trust device.
.INDENT 0.0
.TP
.B Usage
\fB> trust <dev>\fP
.UNINDENT
.SS untrust
.sp
Untrust device.
.INDENT 0.0
.TP
.B Usage
\fB> untrust <dev>\fP
.UNINDENT
.SS block
.sp
Block device.
.INDENT 0.0
.TP
.B Usage
\fB> block <dev>\fP
.UNINDENT
.SS unblock
.sp
Unblock device
.INDENT 0.0
.TP
.B Usage
\fB> unblock <dev>\fP
.UNINDENT
.SS remove
.sp
Remove device.
.INDENT 0.0
.TP
.B Usage
\fB> remove <dev>\fP
.UNINDENT
.SS connect
.sp
Connect device.
.sp
This will initiate a connection to a device.
.sp
By default this commands tries to connect all the profiles the remote device
supports and have been flagged as auto\-connectable. In case when the UUID of
the remote service is given only that service will be connected. The UUID can
be either a short form (16\-bit UUID) or a long form (128\-bit UUID). There are
also some special values for well\-known profiles like \(dqa2dp\-sink\(dq,
\(dqa2dp\-source\(dq, \(dqhfp\-hf\(dq, \(dqhfp\-ag\(dq, \(dqftp\(dq or \(dqspp\(dq.
.sp
To connect with an LE device the controller must have an active scan report of
the device it wants to connect to.
.sp
If no advertising report is received before the timeout a
le\-connection\-abort\-by\-local error will be issued. In that case either try
again to connect assuming the device is advertising.
.INDENT 0.0
.TP
.B Usage
\fB> connect <dev> [uuid]\fP
.TP
.B Example
\fB> connect 1C:48:F9:9D:81:5C\fP
.TP
.B Example
\fB> connect 1C:48:F9:9D:81:5C hsp\-hs\fP
.TP
.B Example
\fB> connect 1C:48:F9:9D:81:5C 00001108\-0000\-1000\-8000\-00805f9b34fb\fP
.TP
.B Example
\fB> connect 1C:48:F9:9D:81:5C 0x1108\fP
.UNINDENT
.SS disconnect
.sp
Disconnect device.
.sp
By default this commands disconnects all profiles and then terminates the
connection. In case when the UUID of the remote service is given only that
service will be disconnected.
.sp
For LE when disconnecting from an active connection the device address is not
needed.
.INDENT 0.0
.TP
.B Usage
\fB> disconnect <dev> [uuid]\fP
.UNINDENT
.SS info
.sp
Device information.
.INDENT 0.0
.TP
.B Usage
\fB> info <dev>\fP
.UNINDENT
.SS bearer
.sp
Get/Set preferred bearer.
.INDENT 0.0
.TP
.B Usage
\fB> bearer <dev> [last\-seen/bredr/le]\fP
.TP
.B Example get preferred bearer
.nf
> bearer <addr>
.in +2
PreferredBearer: last\-seen
.in -2
.fi
.sp
.TP
.B Example set preferred bearer to LE
.nf
> bearer <addr> le
[CHG] Device <addr> PreferredBearer: le
Changing le succeeded
.fi
.sp
.TP
.B Example set preferred bearer to BREDR
.nf
> bearer <addr> bredr
[CHG] Device <addr> PreferredBearer: bredr
Changing bredr succeeded
.fi
.sp
.UNINDENT
.SH ADVERTISE SUBMENU
.sp
See \fBbluetoothctl\-advertise(1)\fP\&.
.SH MONITOR SUBMENU
.sp
See \fBbluetoothctl\-monitor(1)\fP
.SH SCAN SUBMENU
.sp
See \fBbluetoothctl\-scan(1)\fP
.SH GATT SUBMENU
.sp
See \fBbluetoothctl\-gatt(1)\fP
.SH ADMIN SUBMENU
.sp
See \fBbluetoothctl\-admin(1)\fP
.SH PLAYER SUBMENU
.sp
See \fBbluetoothctl\-player(1)\fP
.SH ENDPOINT SUBMENU
.sp
See \fBbluetoothctl\-endpoint(1)\fP
.SH TRANSPORT SUBMENU
.sp
See \fBbluetoothctl\-transport(1)\fP
.SH MANAGEMENT SUBMENU
.sp
See \fBbluetoothctl\-mgmt(1)\fP
.SH ASSISTANT SUBMENU
.sp
See \fBbluetoothctl\-assistant(1)\fP
.SH AUTOMATION
.sp
Two common ways to automate the tool are to use Here Docs or the program expect.
Using Here Docs to show information about the Bluetooth controller.
.INDENT 0.0
.INDENT 3.5
.sp
.EX
bluetoothctl <<EOF
list
show
EOF
.EE
.UNINDENT
.UNINDENT
.SH RESOURCES
.sp
 <http://www.bluez.org> 
.SH REPORTING BUGS
.sp
 <linux\-bluetooth@vger.kernel.org> 
.SH COPYRIGHT
Free use of this software is granted under the terms of the GNU
Lesser General Public Licenses (LGPL).
.\" Generated by docutils manpage writer.
.