On Tue, 17 Dec 2019 15:16:38 +0100, Stefan Seyfried <stefan.seyfried@googlemail.com> wrote:
Hi Jiri,
I'm writing the below hints mostly from reading the tool's manpages, because I have not used them ever (and I have done some debugging on bluetooth issues during the last 15 years... ;-)
I was scanning a README that I once wrote for myself to get my phone connected. Taking this as a starting point ...
Am 17.12.19 um 14:36 schrieb Jiri Slaby:
On 16. 12. 19, 15:39, Stefan Seyfried wrote: : :
/usr/bin/hciattach
A tool to connect serial UART Bluetooth devices. Newer tool is btattach.
Clear and mostly obvious. $ hciattach help hciattach - HCI UART driver initialization utility Usage: hciattach [-n] [-p] [-b] [-r] [-t timeout] [-s initial_speed] <tty> <type | id> [speed] [flow|noflow] [sleep|nosleep] [bdaddr] hciattach -l $ btattach --help btattach - Bluetooth serial utility Usage: btattach [options] options: -B, --bredr <device> Attach Primary controller -A, --amp <device> Attach AMP controller -P, --protocol <proto> Specify protocol type -S, --speed <baudrate> Specify which baudrate to use -N, --noflowctl Disable flow control -h, --help Show help options
/usr/bin/hciconfig /usr/bin/hcitool /usr/bin/sdptool
bluetoothd together with bluetoothctl
Is there a manual describing how to convert scripts using the old tools to describing how that would be done in the new? # hciconfig hci0 up What would I need to do to use the new tools?
/usr/bin/hcidump
btmon (hcidump actually is the one that needs security patches that upstream no longer wants to include)
Clear
/usr/bin/rfcomm
bluetoothd together with bluetoothctl
Same as with the other tools: is there a walkthrough for conversion?
In the not too far future, the bluez-deprecated package will be dropped and bluez will be built without "--enable-deprecated". If I had to guess now, I would say that "not too far future" means "end of 2020".
Perhaps you can also point us to some document defining in favor of what they are deprecated. I.e. what we are supposed to use instead of the above?
I have listed the replacements as far as I know them above below the tools, other tools (or snippets for writing your own) are in the bluez-test package, which consists mostly of small python demo applications.
Basically the upstream reasoning for deprecating these tools is that bluetoothd as the central service is handling all this in a coordinated way and should be used (vie bluetoothctl or desktop applets) to perform the tasks that these tools did. As an example, a manual "hcitool scan" did interfere with things bluetoothd does and settings done with "hciconfig" were not persisted anywhere (and bluetoothd did not know about them and thus did not work correctly), so this is why these tools were deprecated. At least that's how I understood it :-)
I have been using bluetoothctl for almost all my configuration and debugging tasks and could perform all tasks that I needed. It's even better than using a desktop applet, since I can copy and paste the bluetoothctl commands easily into a HOWTO or a bug report ;-)
Have fun,
-- H.Merijn Brand http://tux.nl Perl Monger http://amsterdam.pm.org/ using perl5.00307 .. 5.31 porting perl5 on HP-UX, AIX, and Linux https://useplaintext.email https://tux.nl http://www.test-smoke.org http://qa.perl.org http://www.goldmark.org/jeff/stupid-disclaimers/