how can i get dbus api
Dan Williams
dcbw
Sun Sep 14 21:43:07 PDT 2008
On Sun, 2008-09-14 at 10:27 +0800, Ge Dig wrote:
> Dear all,
>
>
> In wpa supplicaicant, it will register a dbus interface, if we run
> it with -u option,
> but I don't know how to use it.
>
>
> How can i get these APIs document?
There are a few examples, I can can certainly help answer any questions.
It closely follows the socket-based control interface. To be honest,
it's not a great D-Bus interface and we (me and Marcel) have plans to
make it a lot better.
You first want to ask the supplicant whether it already knows about the
network interface you want it to control. If it doesn't, you add that
network interface just like you would in the socket control interface.
Next, you can add networks to the interface's config just like you can
with the socket control interface. Each network is sent to the
supplicant as a D-Bus dictionary (signature "a{sv}") of key/value pairs,
where the keys are the standard ones from supplicant configuration, and
the values are specific to the key type. For example, the SSID gets
sent as a D-Bus byte array (signature "ay") because SSIDs can contain
embedded NULLs are are not UTF-8 safe. Other options get passed as
strings or integers as appropriate, but the config parsing code will
usually figure out what you mean.
See wpa_supplicant/examples/wpas-test.py. Let me know if you have
further questions.
Dan
More information about the Hostap
mailing list