.\" 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: .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 \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 \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 \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 \fP .UNINDENT .SS set\-alias .sp Set device alias. .INDENT 0.0 .TP .B Usage \fB> set\-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 \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 \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 \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 \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 \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 \fP .UNINDENT .SS untrust .sp Untrust device. .INDENT 0.0 .TP .B Usage \fB> untrust \fP .UNINDENT .SS block .sp Block device. .INDENT 0.0 .TP .B Usage \fB> block \fP .UNINDENT .SS unblock .sp Unblock device .INDENT 0.0 .TP .B Usage \fB> unblock \fP .UNINDENT .SS remove .sp Remove device. .INDENT 0.0 .TP .B Usage \fB> remove \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 [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 [uuid]\fP .UNINDENT .SS info .sp Device information. .INDENT 0.0 .TP .B Usage \fB> info \fP .UNINDENT .SS bearer .sp Get/Set preferred bearer. .INDENT 0.0 .TP .B Usage \fB> bearer [last\-seen/bredr/le]\fP .TP .B Example get preferred bearer .nf > bearer .in +2 PreferredBearer: last\-seen .in -2 .fi .sp .TP .B Example set preferred bearer to LE .nf > bearer le [CHG] Device PreferredBearer: le Changing le succeeded .fi .sp .TP .B Example set preferred bearer to BREDR .nf > bearer bredr [CHG] Device 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 < .SH REPORTING BUGS .sp .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. .