* Help me to test top of tree bluetooth subsystem
@ 2009-05-12 12:14 balaji palaniswami
2009-05-12 14:24 ` Vinicius Gomes
0 siblings, 1 reply; 2+ messages in thread
From: balaji palaniswami @ 2009-05-12 12:14 UTC (permalink / raw)
To: linux-bluetooth
[-- Attachment #1: Type: text/plain, Size: 1075 bytes --]
Hi All ,
I have upgraded the ubuntu 8.04 kernel to 2.6.30-rc5 and bluez 4.39. I did pairing with Jabra headset using below pyhton script. I got below error message. This issue is related with ubuntu application dbus. so please advise me which distribution , setup procedure would be suitable to test top tree of bluetooth subsystem.
Thanks,
Balaji.P
Traceback (most recent call last):
File "./bthstereoheadset.py", line 25, in <module>
path = audio.CreateDevice(headsetAddress)
File "/var/lib/python-support/python2.5/dbus/proxies.py", line 68, in __call__
return self._proxy_method(*args, **keywords)
File "/var/lib/python-support/python2.5/dbus/proxies.py", line 140, in __call__
**keywords)
File "/var/lib/python-support/python2.5/dbus/connection.py", line 607, in call_blocking
message, timeout)
dbus.exceptions.DBusException: org.bluez.Error.ConnectionAttemptFailed: Host is down
Now surf faster and smarter ! Check out the new Firefox 3 - Yahoo! Edition http://downloads.yahoo.com/in/firefox/?fr=om_email_firefox
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: bthstereoheadset.py --]
[-- Type: text/x-python; name="bthstereoheadset.py", Size: 1434 bytes --]
#!/usr/bin/python
import dbus
import os
import sys
def printusage():
print 'bthstereoheadset.py <options>'
print ' create - create a stereo headset'
print ' start - connect sink'
print ' stop - disconnect sink'
return
headsetAddress = os.getenv("BTSTEREO_HEADSET")
print 'BT Stereo Headset Is : => %s' % headsetAddress
bus = dbus.SystemBus()
manager = dbus.Interface(bus.get_object('org.bluez', '/org/bluez'), 'org.bluez.Manager')
bus_id = manager.ActivateService('audio')
audio = dbus.Interface(bus.get_object(bus_id, '/org/bluez/audio'), 'org.bluez.audio.Manager')
if len(sys.argv) == 1 :
printusage()
elif len(sys.argv) > 1 and sys.argv[1] == 'create' :
path = audio.CreateDevice(headsetAddress)
audio.ChangeDefaultDevice(path)
sink = dbus.Interface (bus.get_object(bus_id, path), 'org.bluez.audio.Sink')
sink.Connect()
print 'Stereo Headset Connect Done'
elif len(sys.argv) > 1 and sys.argv[1] == 'start' :
path = audio.DefaultDevice()
sink = dbus.Interface (bus.get_object(bus_id, path), 'org.bluez.audio.Sink')
if not sink.IsConnected() :
sink.Connect()
print 'Audio connected'
elif len(sys.argv) > 1 and sys.argv[1] == 'stop' :
path = audio.DefaultDevice()
sink = dbus.Interface (bus.get_object(bus_id, path), 'org.bluez.audio.Sink')
try :
sink.Disconnect()
except dbus.exceptions.DBusException:
print 'Disconnect Failed'
print 'Stereo headset disconnect complete'
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Help me to test top of tree bluetooth subsystem
2009-05-12 12:14 Help me to test top of tree bluetooth subsystem balaji palaniswami
@ 2009-05-12 14:24 ` Vinicius Gomes
0 siblings, 0 replies; 2+ messages in thread
From: Vinicius Gomes @ 2009-05-12 14:24 UTC (permalink / raw)
To: balaji palaniswami; +Cc: linux-bluetooth
Hi Balaji,
On Tue, May 12, 2009 at 9:14 AM, balaji palaniswami
<balaji_palaniswami@yahoo.com> wrote:
> Hi All ,
>
> I have upgraded the ubuntu 8.04 kernel to 2.6.30-rc5 and bluez 4.39. I did pairing with Jabra headset using below pyhton script. I got below error message. This issue is related with ubuntu application dbus. so please advise me which distribution , setup procedure would be suitable to test top tree of bluetooth subsystem.
>
There is an audio devices howto at the wiki[1], which has been updated
recently (thanks Zygo!),
it covers pretty much everything.
Taking a look at the traceback and the script you have provided it
seems that you still are running
a daemon from the old 3.x series. The dbus interface has changed,
please take a look at the *-api.txt
files in the doc directory in a more recent version.
> Thanks,
> Balaji.P
>
>
> Traceback (most recent call last):
> File "./bthstereoheadset.py", line 25, in <module>
> path = audio.CreateDevice(headsetAddress)
> File "/var/lib/python-support/python2.5/dbus/proxies.py", line 68, in __call__
> return self._proxy_method(*args, **keywords)
> File "/var/lib/python-support/python2.5/dbus/proxies.py", line 140, in __call__
> **keywords)
> File "/var/lib/python-support/python2.5/dbus/connection.py", line 607, in call_blocking
> message, timeout)
> dbus.exceptions.DBusException: org.bluez.Error.ConnectionAttemptFailed: Host is down
>
>
> Now surf faster and smarter ! Check out the new Firefox 3 - Yahoo! Edition http://downloads.yahoo.com/in/firefox/?fr=om_email_firefox
Cheers,
--
Vinicius Gomes
INdT - Instituto Nokia de Tecnologia
[1] http://wiki.bluez.org/wiki/HOWTO/AudioDevices
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-05-12 14:24 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-12 12:14 Help me to test top of tree bluetooth subsystem balaji palaniswami
2009-05-12 14:24 ` Vinicius Gomes
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox