Hi,
sorry for not replying earlier

On Nov 14, 2007 7:23 AM, Oscar Schnitzer <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I'm writing a linux bluetooth (BlueZ) application in C++, and as such I'm 
> using the C++ DBus bindings developed by the OpenWengo project (as 
> recommended here: http://www.freedesktop.org/wiki/Software/DBusBindings).  I 
> like these bindings very much, they suit my style of writing C++.
>
> However, the main problem that I've got is one of documentation, and I'm not 
> sure where to look further.  There is doxygen documentation which is 
> generated as part of the build process, but that doesn't really add anything. 
> And there are included examples, but these don't seem to cover all of what 
> I'm trying to do.
>
> I'm not sure if this mailing list is the right place to ask my questions, but 
> as far as I can see there's very few people combining BlueZ and C++ and DBus. 
>  Feel free to refer to me to a more appropriate place if there is one.
>
> Anyway, my question is this.  I'm working on a BlueZ application, and almost 
> all of the BlueZ DBus documentation uses Python for examples, and I have 
> managed to rewrite such code in C++, but there's one class of such code that 
> I'm stuck on.  An example can be found at 
> http://wiki.bluez.org/wiki/HOWTO/SerialConnections
>
> In particular I'm stuck on how to map this line from Python into C++ with the 
> OpenWengo DBus bindings:
>   serial = dbus.Interface(bus.get_object(bus_id, '/org/bluez/serial'), 
> 'org.bluez.serial.Manager')
> As far as I can tell there is no C++/DBus equivalent to this get_object() 
> method.
> Any advice?
>

the equivalent would be to subclass DBus::ObjectProxy, which, as the
name implies, translates your method invocations into D-Bus messages
(and viceversa, from D-Bus signals into the appropriate callback)
such a client-side proxy has of course to implement an interface (or,
in Python terms, a dbus.Interface), this can be done either manually
(subclassing DBus::InterfaceProxy directly like the HAL example) or
automatically, using dbusxx2cpp (in the tools/ folder) on a XML
description of the D-Bus interface (like in the ECHO example),
unfortunately BlueZ doesn't seem to provide such an XML file, which
means you have to write one yourself, like this

http://dev.openwengo.org/trac/openwengo/trac.cgi/browser/wengophone-ng/branches/wengophone-dbus-api/libs/dbus/examples/echo/echo-introspect.xml
(look at the official D-Bus documentation about the format of this file)

you could start from the BlueZ D-Bus API documentation at
http://bluez.cvs.sourceforge.net/*checkout*/bluez/utils/hcid/dbus-api.txt

if you have any other questions, please ask away
_______________________________________________
Wengophone-devel mailing list
Wengophone-devel@lists.openwengo.com
http://dev.openwengo.com/mailman/listinfo/wengophone-devel

Reply via email to