On Fri, 2007-04-20 at 14:39 +0100, Robert Rawlins - Think Blue wrote: > Thanks for that Carsten, > > I've given that a go and I still get similar results to what I've seen in the > past whereby it prints a couple of elements I would expect to see but other > which I'm not sure about, and what seems to be ALOT of blank characters. > > 6e > 555 5 5 5 en j > 5 %OBEX Object Push ÿ > > That's what your suggestion returns to me, I'm using the API to scan a > Bluetooth device for services, one of which is OBEX Object Push, but the rest > of that output is apparent junk. > > Unfortunately the API doesn’t really give any suggestions at all, take a look > here > http://bluez.cvs.sourceforge.net/*checkout*/bluez/utils/hcid/dbus-api.txt if > you look down under the 'adapter' section, I'm running the method called > GetRemoteServiceRecord() which returns the byte array but there really isn’t > any suggestion as to how you extract the information from what's returned.
It says that it returns the binary stream of an SDP database. I seems that the writer of the API documentation assumed that you'd only ask for such a thing if you already know what to do with it. Directly below the GetRemoteServiceRecord method is the description of a method called GetRemoteServiceRecordAsXML. Maybe that'll give you a more readable result? > > I have no idea if we're barking up the right tree here or if we're going > about this the wrong way. That depends entirely on what you want to achieve in the end, which I don't think you told us. You asked how to convert a (dbus) byte array into a string. We told you, but the result isn't as helpful as you hoped. Maybe the following analogy will illustrate the futility of this process. You: I need to get onto the roof of my house. How do I do that? Us: Use a ladder. You: Um, okay... Alright, thanks, I've climbed onto the roof of my house, but I still can't reach the moon. How do I do that? In other words, the more information you give us about what you are actually trying to achieve, the more helpful the advice we can give you. Good luck, Carsten. -- http://mail.python.org/mailman/listinfo/python-list