hcitool(1)

πŸ’– hcitool(1): the Bluetooth config bestie πŸ’–

okay so bestie, welcome to hcitool(1) from the Linux System Administration manual. This is the iconic little page for configuring Bluetooth connections and sending special commands to Bluetooth devices. It’s giving β€œI know my HCI commands and I’m not afraid to use them” energy. πŸ’…

✨ NAME ✨

hcitool β€” Configure Bluetooth connections. periodt.

🌸 SYNOPSIS 🌸

hcitool -h

hcitool COMMAND --help

hcitool [-i hciX] [COMMAND [PARAMETERS]]

πŸ¦‹ DESCRIPTION πŸ¦‹

hcitool(1) is used to configure Bluetooth connections and send some special command to Bluetooth devices. fr fr, that’s the whole vibe.

If no command is given, or if the option -h is used, hcitool prints some usage information and exits. So if you’re ever like β€œwhat do I even type,” it’s got you. 🫢

πŸ’œ OPTIONS πŸ’œ

  • -i <hciX> β€” the command gets applied to device hciX, and that has to be the name of an installed Bluetooth device. If you don’t specify it, the command will be sent to the first available Bluetooth device. lowkey convenient.
  • -h β€” gives a list of possible commands. your little menu moment. ✨

πŸ”₯ COMMANDS πŸ”₯

  • dev β€” display local devices. your local Bluetooth besties.
  • inq β€” inquire remote devices. For each discovered device, the Bluetooth device address, clock offset and class are printed. it’s giving discovery era.
  • scan β€” inquire remote devices. For each discovered device, the device name are printed. yes, the original says it like that; we keep the facts, not the grammar vibes.
  • name <bdaddr> β€” print the device name of the remote device with Bluetooth address bdaddr.
  • info <bdaddr> β€” print the device name, version and supported features of the remote device with Bluetooth address bdaddr.
  • spinq β€” start periodic inquiry process. No inquiry results are printed. it’s doing its own thing quietly.
  • epinq β€” exit periodic inquiry process.
  • cmd <ogf> <ocf> [parameters] β€” submit an arbitrary HCI command to the local device. ogf, ocf and parameters are hexadecimal bytes. very β€œI speak HCI” of you.
  • con β€” display active baseband connections.
  • cc [--role=c|p] [--pkt-type=<ptype>] <bdaddr> β€” create a baseband connection to the remote device with Bluetooth address bdaddr.
    • Option --pkt-type specifies a list of allowed packet types. <ptype> is a comma-separated list of packet types, where the possible packet types are DM1, DM3, DM5, DH1, DH3, DH5, HV1, HV2, HV3. Default is to allow all packet types.
    • Option --role can have value c (do not allow role switch, stay central) or p (allow role switch, become peripheral if the peer asks to become central). Default is c.
  • dc <bdaddr> [reason] β€” delete the baseband connection from the remote device with Bluetooth address bdaddr.
    • The reason can be one of the Bluetooth HCI error codes. Default is 19 for user ended connections. The value must be given in decimal.
  • sr <bdaddr> <role> β€” switch role for the baseband connection from the remote device to central or peripheral.
  • cpt <bdaddr> <ptypes> β€” change packet types for the baseband connection to the device with Bluetooth address bdaddr. ptypes is a comma-separated list of packet types, where the possible packet types are DM1, DM3, DM5, DH1, DH3, DH5, HV1, HV2, HV3.
  • rssi <bdaddr> β€” display received signal strength information for the connection to the device with Bluetooth address bdaddr.
  • lq <bdaddr> β€” display link quality for the connection to the device with Bluetooth address bdaddr.
  • tpl <bdaddr> [type] β€” display transmit power level for the connection to the device with Bluetooth address bdaddr.
    • The type can be 0 for the current transmit power level (which is default) or 1 for the maximum transmit power level.
  • afh <bdaddr> β€” display AFH channel map for the connection to the device with Bluetooth address bdaddr.
  • lp <bdaddr> [value] β€” with no value, displays link policy settings for the connection to the device with Bluetooth address bdaddr.
    • If value is given, sets the link policy settings for that connection to value. Possible values are RSWITCH, HOLD, SNIFF and PARK.
  • lst <bdaddr> [value] β€” with no value, displays link supervision timeout for the connection to the device with Bluetooth address bdaddr.
    • If value is given, sets the link supervision timeout for that connection to value slots, or to infinite if value is 0.
  • auth <bdaddr> β€” request authentication for the device with Bluetooth address bdaddr.
  • enc <bdaddr> [encrypt] β€” enable or disable the encryption for the device with Bluetooth address bdaddr.
  • key <bdaddr> β€” change the connection link key for the device with Bluetooth address bdaddr.
  • clkoff <bdaddr> β€” read the clock offset for the device with Bluetooth address bdaddr.
  • clock [bdaddr] [clock] β€” read the clock for the device with Bluetooth address bdaddr.
    • The clock can be 0 for the local clock or 1 for the piconet clock (which is default).
  • lescan [--privacy] [--passive] [--acceptlist] [--discovery=g|l] [--duplicates] β€” start LE scan. that’s the LE scan moment, no cap.
  • leinfo [--static] [--random] <bdaddr> β€” get LE remote information.
  • lealadd [--random] <bdaddr> β€” add device to LE Accept List.
  • lealrm <bdaddr> β€” remove device from LE Accept List.
  • lealsz β€” read size of LE Accept List.
  • lealclr β€” clear LE Accept List.
  • lerladd [--local_irk] [--peer_irk] [--random] <bdaddr> β€” add device to LE Resolving List.
  • lerlrm <bdaddr> β€” remove device from LE Resolving List.
  • lerlclr β€” clear LE Resolving List.
  • lerlsz β€” read size of LE Resolving List.
  • lerlon β€” enable LE Address Resolution.
  • lerloff β€” disable LE Address Resolution.
  • lecc [--static] [--random] <bdaddr> | [--acceptlist] β€” create a LE Connection.
  • ledc <handle> [reason] β€” disconnect a LE Connection.
  • lecup <handle> <min> <max> <latency> <timeout> β€” LE Connection Update.

🌈 RESOURCES 🌈

<http://www.bluez.org>

⭐ REPORTING BUGS ⭐

<linux-bluetooth@vger.kernel.org>

πŸ‘‘ Author πŸ‘‘

Maxim Krasnyansky <maxk@qualcomm.com>, Marcel Holtmann <marcel@holtmann.org>, Fabrizio Gennari <fabrizio.gennari@philips.com>

Free use of this software is granted under the terms of the GNU Lesser General Public Licenses (LGPL).


This iconic page is brought to you by BlueZ, dated Nov 12, 2002, and the manual tag is hcitool(1). slay. πŸ’–βœ¨

πŸ“¦ where this page comes from