2022-01-25 22:55:24

by Dave Mielke

[permalink] [raw]
Subject: bluetoothctl set-alias - how to select the device

Hi:

It isn't clear to me how bluetoothctl set-alias decides which device to rename. From a bit of a look at the code, it seemed like it might be the most recent connect, but that proved to be an incorrect conclusion. In the same way that select can be used to pick the active controller, is there a way to explicitly pick the active device?

--
I believe the Bible to be the very Word of God: http://Mielke.cc/bible/
Dave Mielke | 2213 Fox Crescent | WebHome: http://Mielke.cc/
EMail: [email protected] | Ottawa, Ontario | Twitter: @Dave_Mielke
Phone: +1 613 726 0014 | Canada K2A 1H7 |


2022-01-26 13:03:58

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: Re: bluetoothctl set-alias - how to select the device

Hi Dave,

On Tue, Jan 25, 2022 at 2:55 PM Dave Mielke <[email protected]> wrote:
>
> Hi:
>
> It isn't clear to me how bluetoothctl set-alias decides which device to rename. From a bit of a look at the code, it seemed like it might be the most recent connect, but that proved to be an incorrect conclusion. In the same way that select can be used to pick the active controller, is there a way to explicitly pick the active device?

It only works while connected currently, we could in theory extend the
command to have an optional 2 parameter so one can enter an address.

> --
> I believe the Bible to be the very Word of God: http://Mielke.cc/bible/
> Dave Mielke | 2213 Fox Crescent | WebHome: http://Mielke.cc/
> EMail: [email protected] | Ottawa, Ontario | Twitter: @Dave_Mielke
> Phone: +1 613 726 0014 | Canada K2A 1H7 |



--
Luiz Augusto von Dentz

2022-01-26 13:46:31

by Dave Mielke

[permalink] [raw]
Subject: Re: bluetoothctl set-alias - how to select the device

[quoted lines by Luiz Augusto von Dentz on 2022/01/25 at 15:18 -0800]

>It only works while connected currently,

Even then, it's unpredictable when more than one device is connected. In my case, for example, it can be my Bluetooth speaker as well as a braille device. I assumed, at first, that maybe it's the most recently connected device, but that, too, wasn't true. When I connected the second device it still changed the alias of the first device.

>we could in theory extend the command to have an optional 2 parameter so one can enter an address.

That, I think, would be very helpful. As I understand it, isn't set-alias only updating local (host-resident) data anyway? Also, given that set-alias isn't predictable anway when more than one device is connected, I think there definitely needs to be a way to explicitly say what one is wanting to do.

--
I believe the Bible to be the very Word of God: http://Mielke.cc/bible/
Dave Mielke | 2213 Fox Crescent | WebHome: http://Mielke.cc/
EMail: [email protected] | Ottawa, Ontario | Twitter: @Dave_Mielke
Phone: +1 613 726 0014 | Canada K2A 1H7 |