2017-05-13 22:55:08

by John Hendy

[permalink] [raw]
Subject: Clarification on deprecated tools (e.g. hciconfig)

Hello,


I use arch linux and noticed that the wiki states that some tools such
as hciconfig are deprecated:[1]

### begin_quote

Some tools such as hcitool and hciconfig have been deprecated
upstream, and are no longer included in bluez-utils. Since these tools
will no longer be updated, it is recommended that scripts be updated
to avoid using them. If you still desire to use them, install
bluez-utils-compat. See FS#53110 and the Bluez mailing list for more
information. [2] [3]

### end_quote

The bluez mailing list post is for a patch with the following heading:

### begin_quote

This marks the following tools as deprecated as they are not longer
maintained or have been replaced by other tools:

hciattach hciconfig hcitool hcidump rfcomm sdptool ciptool gatttool

### end_quote

Is there a source of clarification on which of these tools is simply
"not [no?] longer maintained" vs. "replaced"? I don't auto-enable BT
on my computer and I'd like to switch to whatever I should be using if
for no other reason than the news is fresh now. Perhaps in a year this
method will be completely obsolete; by then I'll have forgotten all
about this and wonder what's wrong.

I'd be happy to update the arch wiki to point to any new information
provided. For what it's worth, I think the information would be
relevant in a widely accessible place (the official bluez site in my
opinion); this question has already popped up in various places. [4]
[5] [6] [7]


Many thanks,
John

[1] https://wiki.archlinux.org/index.php/bluetooth
[2] https://bugs.archlinux.org/task/53110
[3] https://www.spinics.net/lists/linux-bluetooth/msg69239.html
[4] https://www.mail-archive.com/[email protected]/msg166798.html
[5] https://github.com/chrippa/ds4drv/issues/123
[6] https://unix.stackexchange.com/questions/352494
[7] https://www.reddit.com/r/archlinux/comments/5x9yle


2017-05-14 20:55:39

by Barry Byford

[permalink] [raw]
Subject: Re: Clarification on deprecated tools (e.g. hciconfig)

On 14 May 2017 at 18:25, Jonah Petri <[email protected]> wrote:
>
>> On May 14, 2017, at 12:19 PM, Luiz Augusto von Dentz <[email protected]=
om> wrote:
>>> I'd be happy to update the arch wiki to point to any new information
>>> provided. For what it's worth, I think the information would be
>>> relevant in a widely accessible place (the official bluez site in my
>>> opinion); this question has already popped up in various places. [4]
>>> [5] [6] [7]
>>
>> I guess the most practical solution would be to switch everything to
>> use bluetoothctl as much as possible, going with raw or mgmt socket
>> should only be mentioned as a last resort in case something went
>> wrong.
>
> Is bluetoothctl scriptable? It doesn=E2=80=99t seem to be able to take c=
ommands in anything but interactive mode. As far as I can tell, where I us=
ed to do =E2=80=9Chciconfig hci0 up=E2=80=9D as one line in a shell script,=
I now need to write a fully-fledged dbus application to bring up the inter=
face. Is my conclusion correct?

You can do some scripting like the following with bluetoothctl:

bluetoothctl << EOF
power on
EOF


You can also do DBus on the command line. Depending on your system it
might need to be gdbus, dbus-send or busctl etc.

For example with busctl on my system I can do:

busctl call org.bluez /org/bluez/hci0 org.freedesktop.DBus.Properties
Set ssv org.bluez.Adapter1 Powered b true

busctl call org.bluez /org/bluez/hci0 org.freedesktop.DBus.Properties
Set ssv org.bluez.Adapter1 Powered b false


>
> Jonah--
> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth=
" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html

2017-05-14 17:25:42

by Jonah Petri

[permalink] [raw]
Subject: Re: Clarification on deprecated tools (e.g. hciconfig)


> On May 14, 2017, at 12:19 PM, Luiz Augusto von Dentz =
<[email protected]> wrote:
>> I'd be happy to update the arch wiki to point to any new information
>> provided. For what it's worth, I think the information would be
>> relevant in a widely accessible place (the official bluez site in my
>> opinion); this question has already popped up in various places. [4]
>> [5] [6] [7]
>=20
> I guess the most practical solution would be to switch everything to
> use bluetoothctl as much as possible, going with raw or mgmt socket
> should only be mentioned as a last resort in case something went
> wrong.

Is bluetoothctl scriptable? It doesn=E2=80=99t seem to be able to take =
commands in anything but interactive mode. As far as I can tell, where =
I used to do =E2=80=9Chciconfig hci0 up=E2=80=9D as one line in a shell =
script, I now need to write a fully-fledged dbus application to bring up =
the interface. Is my conclusion correct?

Jonah=

2017-05-14 16:19:28

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: Re: Clarification on deprecated tools (e.g. hciconfig)

Hi John,

On Sun, May 14, 2017 at 1:55 AM, John Hendy <[email protected]> wrote:
> Hello,
>
>
> I use arch linux and noticed that the wiki states that some tools such
> as hciconfig are deprecated:[1]
>
> ### begin_quote
>
> Some tools such as hcitool and hciconfig have been deprecated
> upstream, and are no longer included in bluez-utils. Since these tools
> will no longer be updated, it is recommended that scripts be updated
> to avoid using them. If you still desire to use them, install
> bluez-utils-compat. See FS#53110 and the Bluez mailing list for more
> information. [2] [3]
>
> ### end_quote
>
> The bluez mailing list post is for a patch with the following heading:
>
> ### begin_quote
>
> This marks the following tools as deprecated as they are not longer
> maintained or have been replaced by other tools:
>
> hciattach hciconfig hcitool hcidump rfcomm sdptool ciptool gatttool
>
> ### end_quote
>
> Is there a source of clarification on which of these tools is simply
> "not [no?] longer maintained" vs. "replaced"? I don't auto-enable BT
> on my computer and I'd like to switch to whatever I should be using if
> for no other reason than the news is fresh now. Perhaps in a year this
> method will be completely obsolete; by then I'll have forgotten all
> about this and wonder what's wrong.

All the tools using raw socket shall be considered deprecated, these
tools may interfere with the so called Management interface since they
can alter the controller state in a way that other applications cannot
detect. Note that for the most part bluetoothctl will be able to do
pretty much everything you want and more, for those operations not
support over D-Bus that are usually at HCI level you may want to use
btmgmt although we may actually turn hciconfig, hcitool, etc to either
use btmgmt to maintain backward compatibility until distros do the
switch.

> I'd be happy to update the arch wiki to point to any new information
> provided. For what it's worth, I think the information would be
> relevant in a widely accessible place (the official bluez site in my
> opinion); this question has already popped up in various places. [4]
> [5] [6] [7]

I guess the most practical solution would be to switch everything to
use bluetoothctl as much as possible, going with raw or mgmt socket
should only be mentioned as a last resort in case something went
wrong.

>
> Many thanks,
> John
>
> [1] https://wiki.archlinux.org/index.php/bluetooth
> [2] https://bugs.archlinux.org/task/53110
> [3] https://www.spinics.net/lists/linux-bluetooth/msg69239.html
> [4] https://www.mail-archive.com/[email protected]/msg166798.html
> [5] https://github.com/chrippa/ds4drv/issues/123
> [6] https://unix.stackexchange.com/questions/352494
> [7] https://www.reddit.com/r/archlinux/comments/5x9yle
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html



--
Luiz Augusto von Dentz