All of lore.kernel.org
 help / color / mirror / Atom feed
* Request for help with btmgmt
@ 2020-12-23  0:32 KeithG
  2020-12-23  7:53 ` Barry Byford
  0 siblings, 1 reply; 4+ messages in thread
From: KeithG @ 2020-12-23  0:32 UTC (permalink / raw)
  To: linux-bluetooth

I am developing a RPi based audio player. We are trying to add
bluetooth capability to this player. We use alsa and not pulse-audio,
so we need a bit more granular info to get it to run. I have written a
script which is designed to be triggered by udev when a BT device is
added or removed. This script will then use bluetoothctl to get the
capabilities of the device and also add or remove it from a dynamic
database list of MACs in redis. I have a simple script working as I
want from the cli. The key command I am using is 'btmgmt con' which is
the only command I have found that tells me what MACs are currently
connected. I can run this command from the command line as root. I can
set the setuid bit of btmgmt and also get it to run as a user (http in
this case). I cannot, ever, get this command to run when triggered
from udev. I get no response and no error.

1) Why is this particular command (query attached BT MACs) not part of
bluetoothctl?  Is there a security issue?
2) Why can I not run 'btmgmt con' in a script (bash or php) triggered
by udev when the device is added or removed?
3) is there a 'better way' for me to know what device MAC addresses
are attached? I have not found another simple way to get this info.

What I am doing in the script is: if an audio source is attached, I
want to run a bluealsa-aplay service. When an audio sink is attached,
I want to re-set my audio output to the bluealsa device. If it is not
an audio device, I do not care, but do keep track of what is attached
in my database so that the next time the script runs that it is not
queried and is 'known'.

Thanks for the help.

Keith

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-12-26 16:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-23  0:32 Request for help with btmgmt KeithG
2020-12-23  7:53 ` Barry Byford
2020-12-25 20:32   ` KeithG
2020-12-26 16:28     ` KeithG

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.