objective c - How to wake from sleep programmatically? -


i want wake system sleep programmatically, there way this?

i have read following link: http://developer.apple.com/mac/library/qa/qa2004/qa1340.html

this talk getting notification , not sure there way wake system sleep?

i appreciate thread information...

update:

as per suggestion tried iopmschedulepowerevent

code have used:

nscalendardate  *timeintervalsincenow = [nscalendardate datewithtimeintervalsincenow:40]; ioreturn result = iopmschedulepowerevent ((cfdateref)timeintervalsincenow, null, cfstr(kiopmautowake));  

result:

it fails in macbook if lid closed

am doing thing wrong or solution?

you can schedule wake events iopmschedulepowerevent through power manager. may able schedule immediate wake up. pmset command line wrapper power manager. can prevent sleep iocancelpowerchange in cases.

you may able prevent sleep or wake generating mouse or key event. 1 way generate events cgpostkeyboardevent.

edit:

normal sleep different clamshell closed sleep. affect latter must write kernel extension insomnia.


Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -