2007-06-27 16:31:57

by Robert Rawlins

[permalink] [raw]
Subject: [Bluez-users] Service Discovery Issues

Hello Guys,

I'm trying to use the DBUS API to query a device for a service using the example python code from the WIKI documents:

import dbus
bus = dbus.SystemBus();
obj = bus.get_object('org.bluez', '/org/bluez/hci0')
adapter = dbus.Interface(obj, 'org.bluez.Adapter')
handles = adapter.GetRemoteServiceHandles('00:17:B0:A0:E7:09', 'opp')
for handle in handles:
print adapter.GetRemoteServiceRecordAsXML('00:17:B0:A0:E7:09', handle)

However when running this code i get the following error message displayed:

File "./test.py", line 13, in ? print adapter.GetRemoteServiceRecordAsXML('00:17:B0:A0:E7:09', handle) File "/var/lib/python-support/python2.4/dbus/proxies.py", line 169, in __call__ reply_message = self._connection.send_message_with_reply_and_block(message, timeout)dbus.DBusException: org.bluez.Error.UnknownMethod: Method "GetRemoteServiceRecordAsXML" with signature "su" on interface "org.bluez.Adapter" doesn't exist
Do you have any ideas what might be causing this?

Thanks guys,

Rob
_________________________________________________________________
Try Live.com - your fast, personalised homepage with all the things you care about in one place.
http://www.live.com/?mkt=en-gb


Attachments:
(No filename) (286.00 B)
(No filename) (164.00 B)
Download all attachments

2007-06-27 18:00:32

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [Bluez-users] Service Discovery Issues

Hi Robert,

> I'm trying to use the DBUS API to query a device for a service using
> the example python code from the WIKI documents:
>
> import dbus
> bus = dbus.SystemBus();
> obj = bus.get_object('org.bluez', '/org/bluez/hci0')
> adapter = dbus.Interface(obj, 'org.bluez.Adapter')
> handles = adapter.GetRemoteServiceHandles('00:17:B0:A0:E7:09', 'opp')
> for handle in handles:
> print adapter.GetRemoteServiceRecordAsXML('00:17:B0:A0:E7:09', handle)
>
> However when running this code i get the following error message
> displayed:
>
> File "./test.py", line 13, in ?
> print adapter.GetRemoteServiceRecordAsXML('00:17:B0:A0:E7:09',
> handle)
> File "/var/lib/python-support/python2.4/dbus/proxies.py", line 169,
> in __call__
> reply_message =
> self._connection.send_message_with_reply_and_block(message, timeout)
> dbus.DBusException: org.bluez.Error.UnknownMethod: Method
> "GetRemoteServiceRecordAsXML" with signature "su" on interface
> "org.bluez.Adapter" doesn't exist
>
> Do you have any ideas what might be causing this?

try wrapping the handle with dbus.Uint32() to get the right type.

Regards

Marcel



-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users