Open Device Daemon, Progress Resport 3 [GSoC]

Sudharshan S sudharsh at gmail.com
Tue Jun 10 10:45:14 CEST 2008


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

Hello all,
Here are some updates to odeviced over the last few days.
The previous report can be found here,
http://lists.openmoko.org/pipermail/openmoko-devel/2008-June/002969.html

1.) Changed the default plugin configuration externsion from .conf to
.plugin


2.) Yesterday I checked in the power plugin at
org.freesmartphone.Device.Plugins.Power interface.

As of now the plugin exposes the following DBus methods,
* battery_status
* current_energy
* energy_full_design
* get_max_energy
* manufacturer
* model_name
* technology
* type

and the following signals which are self-explainatory
* battery-status-changed (Full, Discharging or Charging)
* low-battery (when battery energy level falls below 10%. This can be
set in power.plugin)

People who are familiar with sysfs will note that implementing the above
is straight forward.

Right now for the low-battery signal I poll the file in sysfs every 300
seconds. Ideally, I should extrapolate and average out the values, but I
suck at math, so need some time to optimise it.

As for the battery-status, the daemon polls the file every 5 seconds
(OMG, this is plain evil), especially considering the fact the
charge-status doesn't change in time. So a read every 5 second, imo
seems very wacky.

The folks at #openmoko suggested inotify, which seems to be perfect
given the task at hand, notification from the OS itself when some file
changes (In this case, battery_status), Based on this I could emit a
signal with status as the payload.

But it seems that the kernel needs some special patches. It would be
cool if someone confirms the presence of inotify in the default kernel
of OM. If yes, wonderful. If no, is there a better method than polling
every n seconds?
I bet I am missing something very trivial here..:)

The code is here,
http://git.freesmartphone.org/?p=openmoko-gsoc2008.git;a=summary


Regards
Sudharshan S
Blog : http://www.sudharsh.wordpress.com
IRC  : Sup3rkiddo @ freenode, GimpNet

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

iEYEARECAAYFAkhOPxoACgkQSsRjJNRMc4lfNACglgup+ZBcA9hhZELOQOimsZkD
wTQAnjrmbKpkc+gyMMK/4Vey4LYbmC4W
=MhD6
-----END PGP SIGNATURE-----



More information about the openmoko-devel mailing list