public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* 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

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