Battery Plugin and more..
After a little chat with mickeyl, I realised that exposing crucial functions like load() and unload() was not that of a good idea considering how odeviced is supposed to closely interact with the underlying devices. Consequently there has been some changes over the last week,
- No DBus interface for the service.
- Plugins have now access to a set of helper functions. Only two at the moment (Think setting up DBus object paths)
- Plugins once loaded become resident, that is they cannot be unloaded. If plugins are to be disabled during startup, just remove them from the “enable” field in the global configuration file.
- Per plugin configuration. Each plugins now have their own configuration. Makes more sense, since this mean plugins can have greater freedom with their settings. I really like how the newly checked in battery plugin exploits this.
- Freshly checked in battery plugin. Makes use of sysfs for its functions viz. get_current_brightness, set_brightness, get_maximum_brightness.
SysFS (/sys in 2.6.x.x) is sort of similar to the /proc filesystem and acts as an interface for user-space applications to control/access various devices. One of the neat things about sysfs is the fact that all files consist of only a single entry. This means I don’t have to write a separate parser to extract data from them. So a simple fprintf or fscanf or even the seemingly mundane “echo” can be used to control the devices.
I am also planning to work on the python shell for odeviced for a while. This will be really convenient for testing the service. Something like this,
> Wifi is_on wlan0
True
The code can be checked out from here. I can’t wait till I get hold of a FreeRunner to test odeviced out.
Filed under: FOSS and Linux, Logs, embedded, freesmartphone.org, gsoc, linux, neo1973, odeviced, openmoko | Leave a Comment
Tags: freerunner, freesmartphone.org, fso, gsoc, neo1973, odeviced
Categories
Twitter Updates
- popcorn 1 day ago
- #roddick takes the first set.. #wimbledon 1 day ago
- oops.. mea culpa... it was a round of trick questions :P 2 days ago
- wtf... electricity was invented???! #mtvindia connect #fail 2 days ago
- Back from #drupal chennai meet.. @ubuntuslave talked about his #gsoc code. Netlink office was swankily modern.. :/ 2 days ago
Archives
- June 2009
- May 2009
- April 2009
- March 2009
- February 2009
- January 2009
- December 2008
- November 2008
- October 2008
- September 2008
- August 2008
- July 2008
- June 2008
- May 2008
- April 2008
- March 2008
- February 2008
- January 2008
- December 2007
- November 2007
- October 2007
- September 2007
- August 2007
- July 2007
- June 2007
- May 2007
- April 2007
- March 2007
- February 2007
- January 2007
- December 2006
- November 2006
- October 2006
- September 2006
Blogroll
Meta
Pages
No Responses Yet to “Battery Plugin and more..”