Thread: iLiad Battery status
View Single Post
Old 10-06-2009, 02:29 AM   #2
hansel
JSR FFD2
hansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheese
 
hansel's Avatar
 
Posts: 305
Karma: 1045
Join Date: Aug 2008
Location: Rotterdam, Netherlands, Europe, Sol 3
Device: iliad
Ioctl() is no simple to handle in a generic way: the parameters are often pointers to structs. But Perl, Python, and Python do it, so.....

It's not difficult to write functions in C, and to make a Lua module with it. I did that with liberdm once, to play with the screen refresh functions. We could make a Lua module with handy Iliad functions. After that you could use them in a Lua script. Of course this is not very handy for experimenting. Directly scripting in Lua would be much cooler.

Edit: There is a Lua module to pack / unpack C-structs exists: http://www.inf.puc-rio.br/~roberto/struct/
Edit: I asked on the Lua list... Alien (http://alien.luaforge.net/) might be a way to implement things like ioctl(). It requires libffi (which is not present on the Iliad, but is a cool thing to have). I'll have a look at this when I have some more spare time...

Last edited by hansel; 10-06-2009 at 03:50 AM.
hansel is offline   Reply With Quote