From: Christopher P. <cpi...@gm...> - 2010-08-17 21:51:17
|
Hi, I've written a number of apps using the low level dbus API but wanted to try dbus-c++ to do a small project. I want to talk to wpa_supplicant to tell it to scan for a certain SSID. You accomplish this in several steps: First, you ask wpa_supplicant for an object path to an interface. Using the command line tools: dbus-send --system --print-reply --type=method_call \ --dest=fi.epitest.hostap.WPASupplicant \ /fi/epitest/hostap/WPASupplicant \ fi.epitest.hostap.WPASupplicant.getInterface \ string:"wlan0" It will return something like: object path "/fi/epitest/hostap/WPASupplicant/Interfaces/0 Now that you have that object path, you can call the method that tells it to begin scanning: dbus-send --system --print-reply --type=method_call \ --dest=fi.epitest.hostap.WPASupplicant \ /fi/epitest/hostap/WPASupplicant/Interfaces/0 \ # Note: using object ID returned by above fi.epitest.hostap.WPASupplicant.Interface.scan It returns 1 to indicate success. Then you wait a while, and request the results with something like: dbus-send --system --print-reply --type=method_call \ --dest=fi.epitest.hostap.WPASupplicant \ /fi/epitest/hostap/WPASupplicant/Interfaces/0 \ fi.epitest.hostap.WPASupplicant.Interface.scan This returns an object consisting of a dictionary and a bunch of data. You can see described with an example: http://old.nabble.com/0.7-not-working-with-linux-2.6.24-td15422455.html So here's my question. I made an XML file to try to describe all of this in a way that dbusxx-xml2cpp would understand, and I got stuck almost immediately because the nature of the Interface object is dynamic. In other words, I can't say: <node name="/fi/epitest/hostap/WPASupplicant/Interfaces/0"> ... </node> because it might not be interface 0 on another system, it might be interface 1, 2, or 100. What's the right way to proceed here? Do I need to not use the proxy object model / code generator all (in which case, is there any point to me using dbus-c++ for this project?) --Chris |