Skip to contentSkip to conversation

bluetoothctl set-alias - how to select the device

DISCUSSION Dave Mielke 2 participants 3 messages Jan 25, 2022 – Jan 26, 2022 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

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?

Signature · 4 lines
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   |
#1 lore raw

Hi Dave,

Quoted 4 lines · Dave Mielke

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.

Quoted 5 lines

--
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   |
Signature · 1 line
Luiz Augusto von Dentz
#2 lore raw

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

Quoted 1 line

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.

Quoted 1 line

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.

Signature · 4 lines
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   |