2007-06-11 15:42:56 +08:00
|
|
|
#!/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
|
2007-08-11 20:56:42 +08:00
|
|
|
|
|
|
|
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
|