LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

l2ping

sends L2CAP echo requests to a Bluetooth device, similar to ping for IP networks

TLDR

Ping a Bluetooth device
$ l2ping [AA:BB:CC:DD:EE:FF]
copy
Send specific number of packets
$ l2ping -c [5] [AA:BB:CC:DD:EE:FF]
copy
Set packet size
$ l2ping -s [1024] [AA:BB:CC:DD:EE:FF]
copy
Use specific Bluetooth adapter
$ l2ping -i [hci0] [AA:BB:CC:DD:EE:FF]
copy
Set timeout
$ l2ping -t [10] [AA:BB:CC:DD:EE:FF]
copy

SYNOPSIS

l2ping [options] bdaddr_

DESCRIPTION

l2ping sends L2CAP echo requests to a Bluetooth device, similar to ping for IP networks. Measures round-trip time, detects packet loss, and tests Bluetooth connectivity. Part of the BlueZ Bluetooth stack.

PARAMETERS

-i hciX

Use specific Bluetooth adapter.
-c count
Number of packets to send.
-s size
Size of data packets in bytes.
-t timeout
Response timeout in seconds.
-d delay
Delay between pings in seconds.
-f
Flood ping mode (no delay between packets).
-r
Reverse ping mode (send echo response instead of echo request).
-v
Verify that response payload is identical to request payload.

INSTALL

sudo apt install bluez
copy
sudo dnf install bluez
copy
sudo pacman -S bluez
copy
sudo apk add bluez
copy
sudo zypper install bluez
copy
brew install bluez
copy
nix profile install nixpkgs#bluez
copy

CAVEATS

Requires root privileges. Not all Bluetooth devices respond to L2CAP pings. The Bluetooth adapter must be up and enabled.

SEE ALSO

Copied to clipboard
Kai