[Bug 254123] Re: Bluetooth not working on Intrepid
kervel
frank.dekervel at smartlounge.be
Tue Nov 4 18:57:09 GMT 2008
hello i was using a small python script to connect to the internet via
my phone using bluetooth PAN. however, it doesn't work anymore in
intrepid.
a closer look shows that the DBUS api of bluez is completely broken on
my system:
$ python
>> import dbus
>> bus = dbus.SystemBus()
>> manager = dbus.Interface(bus.get_object('org.bluez', '/org/bluez'), 'org.bluez.Manager')
>> foo = manager.DefaultAdapter()
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.UnknownMethod: Method "DefaultAdapter" with signature "" on interface "org.bluez.Manager" doesn't exist
while in DBUS manager.c i find this (MANAGER_INTERFACE is defined to
org.bluez.Manager):
static GDBusMethodTable manager_methods[] = {
{ "DefaultAdapter", "", "o", default_adapter },
{ "FindAdapter", "s", "o", find_adapter },
{ "ListAdapters", "", "ao", list_adapters },
{ }
};
dbus_bool_t manager_init(DBusConnection *conn, const char *path)
{
connection = conn;
return g_dbus_register_interface(conn, "/", MANAGER_INTERFACE,
manager_methods, manager_signals,
NULL, NULL, NULL);
}
so according to me it should work.
is there anything missing from my system ? i guess this is what breaks several bluetooth utils on my system. Whatever method or interface i try, i get the same error.
btw this is the python script i use to connect to my phone:
--------------------- snip -----------------------------
#!/usr/bin/python
import dbus
bus = dbus.SystemBus()
manager = dbus.Interface(bus.get_object('org.bluez', '/org/bluez'), 'org.bluez.Manager')
conn = manager.ActivateService('network')
network = dbus.Interface(bus.get_object(conn, '/org/bluez/network'), 'org.bluez.network.Manager')
try:
path = network.ListConnections()[0]
except:
path = network.CreateConnection('00:17:83:3D:CC:1E', 'NAP')
print path
connection = dbus.Interface (bus.get_object(conn, path), 'org.bluez.network.Connection')
connection.Connect()
#now dhclient should run on the "bnep0" interface automatically and internet should work
---------------------- snip ----------------------------
greetings,
Frank
--
Bluetooth not working on Intrepid
https://bugs.launchpad.net/bugs/254123
You received this bug notification because you are a member of
Bluetooth, which is subscribed to bluez-utils in ubuntu.
More information about the Ubuntu-bluetooth
mailing list