odeviced: Progress report

Sudharshan S sudharsh at gmail.com
Tue May 27 17:10:23 CEST 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello everyone,

First of all, I am Sudharshan and will be working on an odeviced
implementation for this year's GSoC.

The implementation language will be a mixture of vala and C along with
DBus. Here is the progress made so far. Of course this is really
preliminary and will change in time,

1.) Dynamic Plugin support through GModule. (Not using GTypeModules though)
2.) Configuration file support using GKeyfile, along with a preliminary
dependency tracking for the plugins
3.) A set of methods exposed at org.freesmartphone.Device to manage
plugins. As of now, only basic stuff like load() and get_device_name()
are present..
4.) Wifi plugin completed with code stolen shamelessy from wifi.[c/h]
present in neod and python-odeviced.

- -------------------------------------------------------------------
Heres how running odeviced looks like now,

sudharsh at loki ~/Projects/odeviced $ sudo odeviced
Starting ODeviced Server....
** (process:25609): DEBUG: service.vala:67: No of plugins loaded: 0
** Message: service.vala:69: Trying to load powercontrol
In powercontrol
** Message: service.vala:95: Successfully loaded powercontrol

** (process:25609): DEBUG: service.vala:67: No of plugins loaded: 1
** Message: service.vala:69: Trying to load wifi
	wifi has dependencies
	Dependency powercontrol already loaded
	Done handling dependencies
** Message: service.vala:95: Successfully loaded wifi

** Message: service.vala:143: idle

Notice how odeviced handles dependencies for wifi
- ------------------------------------------------------------------

The contents of the configuration file in /etc/odeviced.conf is as follows,

[odeviced]
device_name=FreeRunner

[powercontrol]
enable=1

[wifi]
enable = 1
# Just dummy stuff to test the service
depends = powercontrol

- --------------------------------------------------------------------

Now lets see what the wifi plugin does. I am running odeviced on my
laptop so my wlan interface is "wlan0". Lets check if its switched on.
Since it a dbus service I can test it out from a python shell.

>>> proxy
<ProxyObject wrapping <dbus._dbus.SystemBus (system) at 0x2aeba41d36b0>
:1.79 /org/freesmartphone/Device/plugins/wifi at 0x2aeba64cae10>

>>> proxy.is_on("wlan0",
dbus_interface="org.freesmartphone.Device.plugins.wifi")
dbus.Boolean(True)

Lets check if "kitteh0" interface is on,

>>> proxy.is_on("kitteh0",
dbus_interface="org.freesmartphone.Device.plugins.wifi")
dbus.Boolean(False)

- ----------------------------------------------------------------------

The code, in case if anyone is interested is available here
http://sudharsh.unixpod.com/odeviced-20080527.tar.bz2

It would be ubercool if someone tests this on the real device. I am
curious to know the performance of the daemon in comparison to its elder
python cousin.

I would be totally delighted to hear comments, suggestions, flames (ok..
not flames) from the experienced people in here. Especially tips on
improving the code as I am a novice when it comes to writing code.

That would be all..:D

Regards
Sudharshan S
blog : http://www.sudharsh.wordpress.com
irc  : Sup3rkiddo @ freenode

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkg8JF8ACgkQSsRjJNRMc4kgjwCeNSOF34ko/gp0QH3okUFs5J66
MgsAmwRsWv3I1Ut2u8nkCaTc0OxafhDC
=4emO
-----END PGP SIGNATURE-----



More information about the smartphones-standards mailing list