sdptool
Browse Bluetooth SDP services
SYNOPSIS
sdptool [OPTIONS] COMMAND [ARGS...]
PARAMETERS
-i, --bdaddr
Specifies the local Bluetooth adapter's address to use for the operation. If not specified, the default adapter is used.
-l, --l2cap
Requests L2CAP binding for the operation. This is relevant for services that require L2CAP communication.
-t, --rfcomm
Requests RFCOMM binding for the operation. This is relevant for services that require RFCOMM communication.
-x, --xml
Outputs the SDP records in XML format. Useful for programmatic parsing.
-P, --raw
Outputs the raw SDP record data. This is typically used for debugging or advanced analysis.
-h, --help
Displays a help message and exits.
search
Searches for a specific Bluetooth service on remote devices.
browse [
Browses and lists all available Bluetooth services on a specified remote device
records [
Lists all raw SDP records on a specified remote device
add
Adds a local SDP record for a specified service. This makes the service discoverable by other Bluetooth devices connecting to the local machine. Requires root privileges.
del
Deletes a local SDP record for a specified service. This makes the service no longer discoverable. Requires root privileges.
get
Retrieves the local SDP record for a specified service.
set
Sets a specific attribute
DESCRIPTION
sdptool is a command-line utility from the BlueZ Bluetooth protocol stack for Linux. It provides functionalities to discover, browse, and manage Service Discovery Protocol (SDP) records on Bluetooth devices. Users can search for specific services (such as Dial-Up Networking, LAN Access, or Serial Port Profile) on remote devices, list all available services, and also add or remove local SDP records to advertise services offered by the local machine. It's an essential tool for developers and users who need to directly interact with Bluetooth service advertisements and discovery mechanisms.
CAVEATS
Adding or deleting local SDP records typically requires root privileges.
A running Bluetooth daemon (bluetoothd) is necessary for sdptool to function correctly.
Service names (e.g., 'SP', 'DUN') are case-sensitive.
Some specific Bluetooth UUIDs might need to be provided as full UUIDs rather than short names if sdptool doesn't recognize the alias.
SERVICE UUIDS AND NAMES
Bluetooth services are identified by Universally Unique Identifiers (UUIDs), which can be 16-bit, 32-bit, or 128-bit. sdptool often recognizes common 16-bit UUIDs by their short, well-known names (e.g., 'SP' for Serial Port Profile, 'DUN' for Dial-Up Networking Profile). For less common services, you might need to use the full UUID.
LOCAL VS. REMOTE OPERATIONS
Commands like search, browse, and records are used to query services on remote Bluetooth devices.
Commands like add, del, get, and set are used to manage SDP records on the local Bluetooth adapter, advertising services that your machine provides.
HISTORY
sdptool is an integral part of the BlueZ project, the official Bluetooth protocol stack for Linux. BlueZ has been under active development since the early 2000s, providing a comprehensive and robust framework for Bluetooth communication. sdptool emerged as a fundamental utility for interacting with the Service Discovery Protocol (SDP), which is crucial for how Bluetooth devices discover and advertise their capabilities. Its core functionality for SDP operations has remained largely consistent throughout its development.
SEE ALSO
bluetoothd(8), hcitool(1), hciconfig(8), rfcomm(1), l2ping(1)