Bluetooth Low Energy device console app
Windows command-line tool for interacting with Bluetooth LE devices
New in v2.1:
open device [pin]endian command for byte order (Little/Big Endian)pair command: Direct PIN input (pair 123456), all pairing modes supportedunsubs command: Unsubscribe from specific characteristic or all at oncestat command shows pairing informationPrevious in v2.0:
write -nr)read-all)device-info)Windows 10, BT 4.0 adapter
[w]: show available BLE devices (w for wide format with full IDs)<name|#|addr> [pin]: connect to BLE device, with optional pairing PIN<sec>: show/change connection timeout (default: 3 sec)<msec>: pause execution for a certain number of milliseconds[format]: show/change display format (ASCII/UTF8/Dec/Hex/Bin)[format]: show/change send data format[format,...]: show/change received data format (comma-separated list)[little|big]: show/change byte order for read/write operations<service_name|#>: set current service for read/write operations<name>**: read value from characteristic[service]: read all characteristics in a service[-nr] <name>** <value>: write value to characteristic (-nr for WriteWithoutResponse)<name>**: subscribe to value change notifications[<name>**|all]: unsubscribe from specific characteristic or all (default: all)<name>: list all descriptors for a characteristic<char>/<desc>: read descriptor value<char>/<desc> <value>: write descriptor value[<pin>]: pair with optional PINmode=ProvidePin [pin]: pair with PIN (interactive if not provided)mode=ConfirmOnly: pair with confirmation onlymode=DisplayPin: pair when device displays PINmode=ConfirmPinMatch: pair with PIN matching confirmation<text&vars>*: print text and variables to stdout
%id - Bluetooth device ID%addr - device BT address%mac - device MAC address%name - device Bluetooth name%stat - device connection status%NOW, %now, %HH, %hh, %mm, %ss, %D, %d, %T, %t, %z - date/time variables[device_mask]: start device enumeration loop<cmd> <params>: start conditional block* You can use standard C escape characters like \t, \n etc.
** <name> can be “service/characteristic”, characteristic name, or # index
BLE: open ESP32_Device 123456
Connecting to ESP32_Device. It is not paired.
Attempting to pair with PIN...
Pairing successful.
Found 3 services:
#00: GenericAccess
#01: GenericAttribute
#02: Custom Service
BLE: open MyDevice
Connecting to MyDevice. It is not paired.
Attempting to pair...
Device is displaying a PIN. Enter the PIN shown on the device:
PIN: 847293
Pairing successful.
BLE: set #2
Selected service Custom Service.
#00: NotifyChar N
#01: WriteChar W
BLE: subs #0
Subscribed to characteristic NotifyChar (notify)
BLE: unsubs #0
Unsubscribed from NotifyChar.
BLE: unsubs
Unsubscribed from 0 characteristic(s).
BLE: endian big
Byte order set to Big Endian.
BLE: format hex
Current send data format: Hex
Current received data format: Hex
BLE: read #0
hex: 00 01 02 03
// Loop through all devices
foreach
// Connect and if successful
if open $
// Read device name
read #0/#0
// Close connection
close
endif
endfor
//open ESP instead of open ESP32_Device)