Initiates a hi-duty scan for nearby devices.
NOTE: It is recommended to enable Background Scanning in the Bluetooth configuration for this application.
Shows nearby devices.
Displays BLE advertisements. Options:
-r : Raw display mode. Prints binary dump of entire advertisement encoded in hex in addition to formatted display.
-R : Raw display mode only. Prints binary dump of entire advertisement encoded in hex. Does not display formatted advertisement data.
-d duration : Specifies duration to display advertisements. Defaults to 5 seconds.
-a [-e] bdaddr1;bdaddr2;... : Optionally filter by specified Bluetooth device address(es). If the [-e] option follows the -a, the addresses will filtered out (excluded).
-s [-e] scanevent1;scanevent2;...: Optionally filter by specified scan event(s). If the [-e] option follows the -s, the scan events will be filtered out (excluded).
Scan events can be specified by numeric value or name. They are as follows:
Establish a GATT client connection to the device specified by the Bluetooth Device Address. A GATT client may also be referred to as a BLE Central device; the peer device may be referred to as a BLE Peripheral.
By default, the Connect command assumes that the Device Address is a public address. To connect to a device with a random BLE address, use the option "-a random".
Also by default, the Connect command will use the BLE transport. If the peer devices requires it, the connection can be made over the BR/EDR (Basic Rate / Enhanced Data Rate), using the "-t bredr" option.
If successful, the Connect command will return a Connection Id, which is required for any additional operations against a connected device.
Tear down a GATT client connection to a BLE Peripheral. The Connection Id parameter is the id returned from the Connect command.
Discover and list the services provided by a connected BLE Peripheral device.
An optional BLE service UUID may be provided. If ommitted, the Services command will discover all available GATT services.
Service discovery returns the service UUID as well as the handle range associated with that service. It is these handles which are the basis for discovery of service characteristics and descriptors.
Discover and list the service characteristics identified by a specified handle range.
By default, the handle range is the maximum possible value range: 0x001 to 0xFFFF. The start and end handles may be independently specified with the "-s start_handle" and "-e end_handle" options, respectively.
For example, to discover the handle range for a specific service, first use the Services command to obtain the handle range for that service. Then use the Characteristics command to list the service characteristics in that handle range.
Service characteristic discovery returns the characteristic UUID, the handle and value handle, and the properties for that characteristic. The characteristic properties identify what kind of I/O may be performed against that characteristic.
Discover and list characteristic descriptors identified by a specified handle range.
Characteristic descriptor discovery returns the descriptor UUID and the descriptor handle.
Sets the Maximum Transmission Unit size for communication with the connected peer device. By default, the BLE MTU is 23 bytes. It may be increased, depending on the capabilities of the peer device, up to 512 bytes.
Reads an attribute value by the specified handle. Options:
-b buffer_size : Specifies the buffer size to be used for receiving the attribute value. Defaults to 64 bytes. The buffer size specified with this option is separate from the MTU. You generally want to set this buffer size to at least the same size as the current MTU.
-o offset : Specifies an optional offset from which to read the attribute value.
Writes the specified value to an attribute. There are several different write operations:
-r : Specifies a write with no response. From the application perspective, this option will not make a noticeable difference. However, it must match the attribute properties. Only an attribute with the property "WRITE_NR" (found in the display for the "characteristics" command) can service this operation.
-p : Specifies a write prepare operation. Depending on the attribute implementation on the peer device, several write prepare operations may be called before the write(s) are executed (see the -e option).
The write prepare operation supports specifying an offset for the write with the -o option. If specified for any other write operation, the offset is ignored.
-c : Specifes that any previous write prepare operations (which have not been executed) be cancelled.
-e : Specifies that any previous write prepare operations be executed.
Without the -r, -p, -c, or -e option specified, a "normal" write operation, is executed, where the write operation is called and a response is expected before the operation will return to the application.
By default, the data written to the attribute is text. That can be changed with the -n option. If the -n preceeds the data, it is interpretted as a numeric value. This is currently limited to a 32-bit signed integer value.
Turns BLE GATT notification handling on or off, or listens for notifications and displays notification data. Sub-commands:
on : Registers the notification handler. Once the handler is registered, received notifications are either logged to the TLOG, or if the listen sub-command is active, displayed on the CLI.
off : Unregisters the notification handler.
listen : Displays received notifications.
Turns BLE GATT indication handling on or off, or listens for notifications and displays notification data.
Note that because indications involve a response, unlike notifications, if the indication handler is not registered before indications are enabled on the GATT server (BLE Peripheral), you may see errors on the GATT server.
Sub-commands:
on : Registers the indication handler. Once the handler is registered, received indications are either logged to the TLOG, or if the listen sub-command is active, displayed on the CLI.
off : Unregisters the indication handler.
listen : Displays received indications.
Shows the connection state for all possible GATT client connections.
Note that this command shows the actual GATT connection status available from the Bluetooth module.