Pandora's Power Management


Vorporeal

Yes, no, I, this is.
Joined
Sep 13, 2007
Messages
1,614
Age
33
Website
Visit site
THIS IS NOT A THREAD ASKING WHAT POWER MANAGEMENT OPTIONS ARE AVAILABLE. I know that the Pandora can do Suspend to RAM, Suspend to Disk, etc.

My question is this - are applications able to delineate what happens when the lid is closed, and do they get some sort of event that tells them that the lid closed? This would be useful for many things - a music player could override the system setting if it is running and have the LCD just turn off, a game could have its own setting, etc. Depending on the application, different default lid-closed power management options would be ideal.
 
I would assume its just another "button" and that you can look for messages for it like any other key and respond to it how you like, and I would also assume that someone will release a bit of simple code to enable and disable LCD :)
 
I believe my linux laptop (Thinkpad x61t) generates an ACPI event when the lid closes, which can trigger things such as suspend to ram or disk. I don't use it, and I probably wouldn't use it on the Pandora, because sometimes I have the lid closed when listening to music, and a key combination right before closing it isn't really that much of an inconvenience.
 
Yes, there is a hall effect sensor. I know hardware-wise how the lid closing works, but I'm curious about how you'd dev it in on the software end (in an application).
 
I'd imagine you could register a callback with the OS for that or something :)

Like RegisterMySuperCoolCallBackForWhenUserDoesSomeThingWithTheLid((int* myfunc)(int action)); and you should return what action to take instead.

edit: BTW the function pointer syntax is probably wrong. I'll never remember how to declare function pointers right off the top of my head :p
 
I think you'd do a (void * myfunc) or somewhat. Oh, and that is quite a snazzy function name. I think I'll have to borrow that to use in some program I write that uses a lid-close event.
 
well I think it would be just simple for the system to send a signal to all user and system applications(like how linux can do USR1, TERM, USR2, and others in the terminal. We could always have a custom signal you know.. and programs that are able to know what the signal means would react and optimize accordingly. That is how I would go about doing it.
 
Back
Top