mirror of
https://git.kernel.org/pub/scm/bluetooth/bluez.git
synced 2024-11-29 15:14:31 +08:00
28 lines
637 B
Python
Executable File
28 lines
637 B
Python
Executable File
#!/usr/bin/python
|
|
|
|
import dbus
|
|
|
|
bus = dbus.SystemBus()
|
|
|
|
manager = dbus.Interface(bus.get_object('org.bluez', '/org/bluez'),
|
|
'org.bluez.Manager')
|
|
|
|
conn = manager.ActivateService('audio')
|
|
|
|
audio = dbus.Interface(bus.get_object(conn, '/org/bluez/audio'),
|
|
'org.bluez.audio.Manager')
|
|
|
|
try:
|
|
headset = dbus.Interface(bus.get_object(conn, audio.DefaultHeadset()),
|
|
'org.bluez.audio.Headset')
|
|
except:
|
|
pass
|
|
|
|
try:
|
|
device = dbus.Interface(bus.get_object(conn, audio.DefaultDevice()),
|
|
'org.bluez.audio.Device')
|
|
sink = dbus.Interface(bus.get_object(conn, audio.DefaultDevice()),
|
|
'org.bluez.audio.Sink')
|
|
except:
|
|
pass
|