Re: Cancel Sleep
Re: Cancel Sleep
- Subject: Re: Cancel Sleep
- From: Brian Bergstrand <email@hidden>
- Date: Sun, 30 Dec 2007 03:13:44 +0200
On Dec 30, 2007, at 2:51 AM, Andrew James wrote:
The users are 100% fine with the idea and all i want to know is if
its possible and if so how, it seems no matter where i ask this
question i am confronted with other developers views and not a
solution
_______________________________________________
I gave you a solution, just for the wrong environment (since you
didn't specify). For the kernel, you will need to be an IOKit driver
to get power events (there may be someway to get them from a "normal"
kext as well). With some basic searching on Google you would have found:
http://developer.apple.com/documentation/DeviceDrivers/Conceptual/IOKitFundamentals/PowerMgmt/chapter_10_section_6.html#/
/apple_ref/doc/uid/TP0000020-SW3
However, it does not look like you can prevent sleep at the kernel
level (even idle sleep) when receiving these events. You may have to
resort to some hackery to tickle an event stream to trick the system
into thinking it's not idle - thus preventing idle sleep.
Probably the easiest thing to do would be to have a user-land daemon
launch when your kext loads and you can then use the solution I gave
in my previous email. When your kext unloads, have the daemon quit.
Again, however you cannot prevent any user-initiated sleep.
Brian Bergstrand
<http://www.bergstrand.org/brian/> PGP Key ID: 0xB6C7B6A2
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden