* [Bluez-users] Service Discovery Issues
@ 2007-06-27 16:31 Robert Rawlins
2007-06-27 18:00 ` Marcel Holtmann
0 siblings, 1 reply; 7+ messages in thread
From: Robert Rawlins @ 2007-06-27 16:31 UTC (permalink / raw)
To: bluez-users
[-- Attachment #1.1: Type: text/plain, Size: 1237 bytes --]
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
[-- Attachment #1.2: Type: text/html, Size: 1645 bytes --]
[-- Attachment #2: Type: text/plain, Size: 286 bytes --]
-------------------------------------------------------------------------
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/
[-- Attachment #3: Type: text/plain, Size: 164 bytes --]
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Bluez-users] Service Discovery Issues
2007-06-27 16:31 [Bluez-users] Service Discovery Issues Robert Rawlins
@ 2007-06-27 18:00 ` Marcel Holtmann
0 siblings, 0 replies; 7+ messages in thread
From: Marcel Holtmann @ 2007-06-27 18:00 UTC (permalink / raw)
To: BlueZ users
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
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Bluez-users] Service Discovery Issues
@ 2007-06-27 18:26 Robert Rawlins
2007-06-28 15:00 ` Marcel Holtmann
0 siblings, 1 reply; 7+ messages in thread
From: Robert Rawlins @ 2007-06-27 18:26 UTC (permalink / raw)
To: bluez-users
[-- Attachment #1.1: Type: text/plain, Size: 765 bytes --]
Hello Marcel,
Thanks for the quick response.
>> try wrapping the handle with dbus.Uint32() to get the right type.
I've tried wrapping that now so the line of code now looks like:
print adapter.GetRemoteServiceRecordAsXML('00:17:B0:A0:E7:09', dbus.Uint32(handle))
But I get a different error this time around:
AttributeError: 'module' object has no attribute 'Uint32'
I'm not too bothered if we're not able to get this XML version working, I just need a method of getting the channel/port from the device, which ever solution is simplest and fastest.
Thanks for your help Marcel,
Rob
_________________________________________________________________
Feel like a local wherever you go with BackOfMyHand.com
http://www.backofmyhand.com
[-- Attachment #1.2: Type: text/html, Size: 1442 bytes --]
[-- Attachment #2: Type: text/plain, Size: 286 bytes --]
-------------------------------------------------------------------------
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/
[-- Attachment #3: Type: text/plain, Size: 164 bytes --]
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Bluez-users] Service Discovery Issues
2007-06-27 18:26 Robert Rawlins
@ 2007-06-28 15:00 ` Marcel Holtmann
0 siblings, 0 replies; 7+ messages in thread
From: Marcel Holtmann @ 2007-06-28 15:00 UTC (permalink / raw)
To: BlueZ users
Hi Robert,
> >> try wrapping the handle with dbus.Uint32() to get the right type.
>
> I've tried wrapping that now so the line of code now looks like:
>
> print adapter.GetRemoteServiceRecordAsXML('00:17:B0:A0:E7:09',
> dbus.Uint32(handle))
>
> But I get a different error this time around:
>
> AttributeError: 'module' object has no attribute 'Uint32'
I am not a Python guru, but you might simply start using the Python
D-Bus documentation to find it out by yourself. Maybe it is dbus.UInt32.
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
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Bluez-users] Service Discovery Issues
@ 2007-06-28 16:26 Robert Rawlins
2007-06-28 16:32 ` Marcel Holtmann
0 siblings, 1 reply; 7+ messages in thread
From: Robert Rawlins @ 2007-06-28 16:26 UTC (permalink / raw)
To: bluez-users
[-- Attachment #1.1: Type: text/plain, Size: 1000 bytes --]
Hi Marcel,
Thanks for getting back to me, you were correct to say that it is UInt32, However even with that implemented, we're then back to the original error message again stating that the function doesn't exist, is it possible that I have a version of the API with that method missing? or it has perhaps been depreciated or renamed?
However, the standard GetRemoteServiceRecord() method appears to be in the API and I can get that to return the byte array to me, unfortunately I have no idea how to turn the byte array into anything useful for me to be able to extract the channel/port from, after speaking with quite a few people on the python and dbus mailing lists they were all a little stumped too.
I'd love to hear any more advice you can offer on either the XML or the ByteArray methods,
Thanks mate,
Rob
_________________________________________________________________
The next generation of MSN Hotmail has arrived - Windows Live Hotmail
http://www.newhotmail.co.uk
[-- Attachment #1.2: Type: text/html, Size: 1168 bytes --]
[-- Attachment #2: Type: text/plain, Size: 286 bytes --]
-------------------------------------------------------------------------
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/
[-- Attachment #3: Type: text/plain, Size: 164 bytes --]
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Bluez-users] Service Discovery Issues
2007-06-28 16:26 Robert Rawlins
@ 2007-06-28 16:32 ` Marcel Holtmann
0 siblings, 0 replies; 7+ messages in thread
From: Marcel Holtmann @ 2007-06-28 16:32 UTC (permalink / raw)
To: BlueZ users
Hi Robert,
> Thanks for getting back to me, you were correct to say that it is
> UInt32, However even with that implemented, we're then back to the
> original error message again stating that the function doesn't exist,
> is it possible that I have a version of the API with that method
> missing? or it has perhaps been depreciated or renamed?
>
> However, the standard GetRemoteServiceRecord() method appears to be in
> the API and I can get that to return the byte array to me,
> unfortunately I have no idea how to turn the byte array into anything
> useful for me to be able to extract the channel/port from, after
> speaking with quite a few people on the python and dbus mailing lists
> they were all a little stumped too.
>
> I'd love to hear any more advice you can offer on either the XML or
> the ByteArray methods,
then you are not running bluez-utils-3.12 and you should. Fix that
first.
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
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Bluez-users] Service Discovery Issues
@ 2007-06-28 16:47 Robert Rawlins
0 siblings, 0 replies; 7+ messages in thread
From: Robert Rawlins @ 2007-06-28 16:47 UTC (permalink / raw)
To: bluez-users
[-- Attachment #1.1: Type: text/plain, Size: 825 bytes --]
Hi Marcel,
It was only a guess on my part that the function doesn't actually exist, however, I've just checked my bluez version and i'm running 3.7. Whilst the XML version would be very nice, I'm more than happy to work the the byte array if i can convert it into something legible. At the moment i've only been able to get something like this:
6e
5 555 5 5 5 en j 5 %OBEX Object Push ÿ
which is using : adapter.GetRemoteServiceRecord('00:17:B0:A0:E7:09', dbus.UInt32(handle), byte_arrays=True))
Thanks for your advice Marcel, it is greatly appreciated.
Rob
_________________________________________________________________
100’s of Music vouchers to be won with MSN Music
https://www.musicmashup.co.uk/index.html
[-- Attachment #1.2: Type: text/html, Size: 1473 bytes --]
[-- Attachment #2: Type: text/plain, Size: 286 bytes --]
-------------------------------------------------------------------------
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/
[-- Attachment #3: Type: text/plain, Size: 164 bytes --]
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2007-06-28 16:47 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-27 16:31 [Bluez-users] Service Discovery Issues Robert Rawlins
2007-06-27 18:00 ` Marcel Holtmann
-- strict thread matches above, loose matches on Subject: below --
2007-06-27 18:26 Robert Rawlins
2007-06-28 15:00 ` Marcel Holtmann
2007-06-28 16:26 Robert Rawlins
2007-06-28 16:32 ` Marcel Holtmann
2007-06-28 16:47 Robert Rawlins
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox