Correct use of IOPMAssertionCreateWithName(...)
Correct use of IOPMAssertionCreateWithName(...)
- Subject: Correct use of IOPMAssertionCreateWithName(...)
- From: James Bucanek <email@hidden>
- Date: Mon, 8 Mar 2010 22:39:06 -0700
Greetings,
I'm not sure that Darwin-Dev is the right place to post this,
but since this is essentially an IOKit question, it's the
closest I could find to the topic.
I'm upgrading my app and would like to use
IOPMAssertionCreate()/IOPMAssertionCreateWithName() to prohibit
the computer from going to sleep while performing a backup.
However, the documentation seems a little vague, which has left
me wondering exactly how these functions should be used.
Do I:
(a) Call IOPMAssertionCreateWithName() when starting an action
that should not be interrupted by sleep mode and then call
IOPMAssertionRelease() when that's over.
Or (b) do I call IOPMAssertionCreateWithName() with
kIOPMAssertionLevelOn when the action starts, immediately call
IOPMAssertionRelease() to release the assertion_id, and then
later call IOPMAssertionCreateWithName() with
kIOPMAssertionLevelOff when the task is complete.
Or (c) ?
I guess my question is really "what sequence of calls establish
and rescind the sleep mode prohibition?" I skimmed the IOKit
documentation and didn't find anything illuminating. I couldn't
find any example code that employed these calls.
TIA,
James
--
James Bucanek
_______________________________________________
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