You are not logged in.

#1 2022-03-29 13:59:12

mutcianm
Member
Registered: 2020-03-03
Posts: 3

Reduce extreme verbosity of bluetoothctl scan

Environment

Kernel: 5.15.28-1-lts
Bluez: 5.63-2

Problem description

Scanning for new Bluetooth devices using bluetoothctl results in unusable output due to the extreme verbosity of the "scan on" command.

[bluetooth]# scan on
Discovery started
[CHG] Controller 00:1A:7D:DA:71:13 Discovering: yes
[NEW] Device 90:32:4B:7E:ED:58 TV
[CHG] Device 90:32:4B:7E:ED:58 RSSI: -52
[CHG] Device 90:32:4B:7E:ED:58 TxPower: 10
[CHG] Device 90:32:4B:7E:ED:58 UUIDs: 0000110a-0000-1000-8000-00805f9b34fb
[CHG] Device 90:32:4B:7E:ED:58 UUIDs: 0000110c-0000-1000-8000-00805f9b34fb
[CHG] Device 90:32:4B:7E:ED:58 UUIDs: 0000110e-0000-1000-8000-00805f9b34fb
[CHG] Device 90:32:4B:7E:ED:58 UUIDs: 00001200-0000-1000-8000-00805f9b34fb
[CHG] Device 90:32:4B:7E:ED:58 UUIDs: 00000000-0000-0000-0000-000000000000
[CHG] Device 90:32:4B:7E:ED:58 ManufacturerData Key: 0x000f
[CHG] Device 90:32:4B:7E:ED:58 ManufacturerData Value:
  00 01 64                                         ..d             
[NEW] Device C8:69:CD:0B:D9:B6 C8-69-CD-0B-D9-B6
[CHG] Device 90:32:4B:7E:ED:58 RSSI: -87
[NEW] Device 00:1A:22:13:B9:AA CC-RT-BLE
[CHG] Device 90:32:4B:7E:ED:58 RSSI: -96
[CHG] Device 90:32:4B:7E:ED:58 RSSI: -53
[CHG] Device 90:32:4B:7E:ED:58 RSSI: -70
[CHG] Device 90:32:4B:7E:ED:58 UUIDs: 0000110a-0000-1000-8000-00805f9b34fb
[CHG] Device 90:32:4B:7E:ED:58 UUIDs: 0000110c-0000-1000-8000-00805f9b34fb
[CHG] Device 90:32:4B:7E:ED:58 UUIDs: 0000110e-0000-1000-8000-00805f9b34fb
[CHG] Device 90:32:4B:7E:ED:58 UUIDs: 00001200-0000-1000-8000-00805f9b34fb
[CHG] Device 90:32:4B:7E:ED:58 UUIDs: 00000000-0000-0000-0000-000000000000
[CHG] Device 90:32:4B:7E:ED:58 UUIDs: cbbfe0e2-f7f3-4206-84e0-84cbb3d09dfc
[CHG] Device 90:32:4B:7E:ED:58 RSSI: -59
[CHG] Device 90:32:4B:7E:ED:58 RSSI: -96
[CHG] Device 90:32:4B:7E:ED:58 RSSI: -71
[CHG] Device 90:32:4B:7E:ED:58 RSSI: -96
[CHG] Device 90:32:4B:7E:ED:58 RSSI: -59
[CHG] Device 00:1A:22:13:B9:AA ManufacturerData Key: 0x0000
[CHG] Device 00:1A:22:13:B9:AA ManufacturerData Value:
  00 00 00 00 00 00 00 00 00                       .........       

...

For the purpose of simply pairing a new device this level of verbosity is completely unnecessary.
And frankly it's not just unnecessary, it makes the command almost completely unusable because the insane rate with which bluetoothctl spams those info messages completely overwhelms any useful info.
The only important output would be the "[NEW] ..." events, but I could figure out a way of leaving just them.

Apparently there's no documentation on bluetoothctl: no manpages, no github wiki of any kind.
I've only managed to find some API docs on the kernel git(https://git.kernel.org/pub/scm/bluetoot … t/tree/doc) but they only describe the low-level kernel API.
I've tried experimenting with "menu scan" options, but could find a way to exclude events by type(e.g. NEW/CHG/DEL)

It would be really great if someone had already found a proper solution and would like to share it

Offline

Board footer

Powered by FluxBB