how can i get dbus api

Ge Dig dig.ge.cn
Mon Sep 15 08:10:51 PDT 2008


Dear Dan & Kiran,

2008/9/15 Kiran Kulkarni <kiran.1267 at gmail.com>

> Dan Williams wrote:
>
>> 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
>>
>>
>>
>> _______________________________________________
>> HostAP mailing list
>> HostAP at lists.shmoo.com
>> http://lists.shmoo.com/mailman/listinfo/hostap
>>
>>
>>
> Yeah I think Dan has given the overview on the DBus API. one month ago I
> asked the same question....
> So if u know the DBus really well then u can dig it out from the code
> I can tell you the Method names that u can call from the DBus Interface
> Details I think Dan can give it to u or u can find out from the code.
>
> These are not all APIs but important one
>
> 1) wpa_supplicant interface
> a) addInterface argument:Interface name returns: object path
> b) getInterface argument: Interface name return: object path
> 2) wpa_supplicant Interface interface
> a) scan
> b) scanResults returns: array of bssids
> c) setAPScan argument: integer returns: success or failure
> d) addNetwork returns: network object path
> e)selectNetwork argument: network object path returns: scuccess or failure
> 3) wpa_supplicant bssid interface
> a) properties returns: hash containing the properties of that bssid
> 4) wpa_supplicant network interface
> a) disable returns: success or failure
> b) set argument: hash table with all properties returns: success or Failure
> c) enable returns: success or failure
>
> I used following APIs only but there are more Available u have to see the
> code
> Also hash table is format is also specified, Dan gave example of SSID.
>
> I request Dan that he should create a WEB page for DBus API...
> Lots of people can contribute to those API then
>



Thanks for your help, I can scan APs with wpa_supplicant now.

Thanks again.


Regards,
 Dig Ge
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.shmoo.com/pipermail/hostap/attachments/20080915/6910c0b7/attachment.htm 



More information about the Hostap mailing list