On Saturday 27 June 2009, Joachim Ott wrote: > 2009/6/27 kimaidou <[email protected]>: > > So here are my questions : > > * what is the command line to activate the wifi (it is long to open the > > Setting apps, then wait then open the "Connectivity" etc.) > > * what is the command line to deactivate it the proper way ? > > You could use mdbus to check and set the wifi power:
dbus-send works faster than mdbus so is a better option in scripts. > "mdbus -s org.freesmartphone.odeviced > /org/freesmartphone/Device/PowerControl/WiFi > org.freesmartphone.Device.PowerControl.GetPower" should return True or > False > > Use the method "SetPower" to enable or disable it. I don't think this is the proper way. Instead of using the low level Device interface you should use the higher level Usage interface. See [1] for why. The equivalent command would be: mdbus -s org.freesmartphone.ousaged /org/freesmartphone/Usage org.freesmartphone.Usage.GetResourceState WiFi To enable or disable it you should ideally use RequestResource and ReleaseResource, but these only hold the resource while the dbus connection is maintained so are useless from scripts. SHR's ophonekitd has a script-friendly interface to this, but I haven't tried it. Instead I use SetResourcePolicy which takes values enabled, auto or disabled. Auto is the default policy which enables the resource if anything has requested it, and disables it when everything has released it. http://git.freesmartphone.org/?p=specs.git;a=blob_plain;f=html/usage- intro.html;hb=HEAD _______________________________________________ Shr-User mailing list [email protected] http://lists.shr-project.org/mailman/listinfo/shr-user
